[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] strncpy(3), die, die, die.

From: Anthony J. Bentley
Subject: Re: [Nmh-workers] strncpy(3), die, die, die.
Date: Mon, 24 Oct 2016 13:08:22 -0600

P Vixie writes:
> On October 24, 2016 6:37:16 PM GMT+02:00, Ken Hornstein <address@hidden> wrot
> e:
> >I dunno, I think we'd need to think carefully if a particular use of
> >strncpy() really warrants an abort vs a truncate.  I mean, just
> >crapping
> >out on a really long line that other MUAs handle just fine seems rather
> >unfriendly to me.  What do others think?
> Copy or die, as the default behavior.
> Silent truncation should require explicit coding.
> Strlcpy is completely bogus.

What's silent about strlcpy? Just check the return value against the size
of the buffer.

Anthony J. Bentley

reply via email to

[Prev in Thread] Current Thread [Next in Thread]