LWN.net Logo

strlcpy

strlcpy

Posted Jun 12, 2003 15:55 UTC (Thu) by tjc (guest, #137)
In reply to: strlcpy by ncm
Parent article: strlcpy

First, since it performs a partial copy, it's easy for code (even code that checks and acts correctly on its return value) to end up using the partial, incorrect copy.

But this is better behavior than strncpy(), which also performs a partial copy but leaves it unterminated.

I don't see that it's the job of low-level library functions to anticipate every error that a programmer might possibly make.


(Log in to post comments)

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