|
|
Subscribe / Log in / New account

The ups and downs of strlcpy()

The ups and downs of strlcpy()

Posted Nov 4, 2013 20:07 UTC (Mon) by rmongiovi (guest, #93769)
Parent article: The ups and downs of strlcpy()

Let me see if I've got this straight. Linux doesn't get strlcpy, which would be quite useful for code portability, because it could cause you to silently lose data?

Well, golly. I guess we'd better undefine snprintf then.

Or maybe we just ought to admit that even though they aren't perfect, having a consistent suite of routines that work with strings and have a maximum length parameter is a useful thing.

No one is forcing anyone to use these calls. And no one is preventing anyone from checking for truncation after the call. But I will go on record as saying that it's effing annoying to have someone decide for me what's good for me. I'm a grownup who can make that decision for myself.....


to post comments


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