Re: gcc-9.2.0 and spurious warnings

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

 



Thanks for the help, Jeff!

On Thu, Dec 12, 2019 at 01:41:08PM -0700, Jeff Law wrote:
> I believe it's telling you that the supplied length is zero and that
> you haven't changed the destination string.  For that to be true, q
> must have the same value as p.  I suspect most of the time a zero
> length parameter to strncpy is unintentional.

I agree that strncpy() CAN be called with length==0. But this can happen only
when get_word() is passed an empty string.

Is it really evil to deal with empty strings? =8-O

-- 
Josef Wolf
jw@xxxxxxxxxxxxx



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux