Hi Roger!
24 Jan 98, Roger Scudder kl“bistab klaverit >> Mart Oruaas:
RS> Are you sure about the '\0' being appended? I know that
RS> strncpy does not append a NUL. I thought that the behavior
RS> was consistent across all the strnxxx functions.
i don't know, whether all versions of strncpy() add \0 or not, but at least
it's so under linux with libc 5.3.12.
hmm, i just checked the strncpy man page again, and it says that result is
not necessarily null-terminated. weird, considering the results of my little
test program. anyway, it seems to be safer to add \0 "manually" when using
strncpy().
fazz
--- GEcho 1.11+
---------------
* Origin: l'Ermite (FidoNet 2:490/18)
|