strncpy

Dave Jones djones at megatest.UUCP
Fri Dec 22 10:08:11 AEST 1989


>From article <11509 at csli.Stanford.EDU>, by poser at csli.Stanford.EDU (Bill Poser):
> 
> ... I claim that strncpy is mis-designed and should
> null-terminate. Any comments?
> 


I grepped through a bunch of my code, and it all adds a null everywhere
it calls strncpy. So a null-terminating strncpy would seem to be useful.
But don't name it strncpy! There just may be code out there that depends on
it working the way it's documented. Call it strncpy0 or something.



More information about the Comp.lang.c mailing list