strncpy

Dave Hammond daveh at marob.masa.com
Tue Jan 23 22:04:16 AEST 1990


In article <11864 at csli.Stanford.EDU> poser at csli.stanford.edu writes:
>Note also that strncpy does not copy "an exact number of characters".
>It copies up to N characters, stopping at the first null.

>From the Xenix manual page for string(S):

char *strncpy(S1,S2,N)
...
strncpy copies exactly N characters, truncating or null-padding S2; the
target may not be null-terminated if the length of S2 is N or more.
...

--
Dave Hammond
daveh at marob.masa.com
uunet!masa.com!marob!daveh



More information about the Comp.lang.c mailing list