4 ms·
Or more likely strncpy plus forced last NUL. Return a flag on truncation unlike messing with return code or errno. Call it safe_strncpy and be done with it. Ot
by AstralStorm 3y ago
Or more likely strncpy plus forced last NUL. Return a flag on truncation unlike messing with return code or errno.
Call it safe_strncpy and be done with it. Otherwise asprintf and snprintf exist.
strlcpy is a more garbage version of snprintf.