[Info-vax] strncpy(), was: Re: Whither VMS?
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Sat Oct 3 12:53:07 EDT 2009
On 2009-10-03, Mark Daniel <mark.daniel at wasd.vsm.com.au> wrote:
>
> strncpy() may not overflow but then it does not terminate the copied
> chars when that happens either. The whole null-termination approach is
> a crock (much as I use it).
I've made it a point to _always_ place a null in the past position of a
buffer after a call to strncpy() for exactly that reason.
IMHO, whoever specified the strncpy semantics deserves to be shamed.
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980's technology to a 21st century world
More information about the Info-vax
mailing list