@da_667 LMAO this os exactly why the MSVC "secure"/Annex K interfaces are utterly useless. Passing the wrong size twice is no more a deterrent than passing the wrong size once.
(FWIW strncpy is also the wrong thing to use here, as it's for null padded buffers not null terminated and will fail to terminate when buffer is full. It can be used to construct thr right thing but that's not its purpose and it's not well suited.)