The majority of our calls to strncpy are in the form (void) strncpy(dst, src, n); dst[n] = '\0'; so add a new routine, copynchars, which does that. A few calls care about strncpy's return value and at least one relies on it only copying a substring without also terminating the output, but most don't care about either and none seem to care that `n' ought to have type size_t instead of int. The new routine matches our usage better, but I haven't gone through to change the existing strncpy calls.
89 KiB
89 KiB