LWN.net Logo

A turning point for GNU libc

A turning point for GNU libc

Posted Apr 3, 2012 6:58 UTC (Tue) by smurf (subscriber, #17840)
In reply to: A turning point for GNU libc by gdt
Parent article: A turning point for GNU libc

That code doesn't make any sense whatsoever. strlcpy does write a trailing zero.
What he wants is essentially a string copy which, when the buffer is too small, zeroes the buffer's FIRST byte, not its last.


(Log in to post comments)

A turning point for GNU libc

Posted Apr 9, 2012 11:04 UTC (Mon) by gdt (subscriber, #6284) [Link]

You're right, I was thinking of strncpy().

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds