The ups and downs of strlcpy()
Posted Jul 19, 2012 22:10 UTC (Thu) by
nix (subscriber, #2304)
In reply to:
The ups and downs of strlcpy() by etienne
Parent article:
The ups and downs of strlcpy()
And obviously lose the use of any string whatsoever in a place where you cannot allocate memory.
Places where you cannot allocate memory are vanishingly rare (excepting in OOM situations, where the only sane thing to do is to terminate the process and let a parent deal with it). It is not worth crippling the string API just for this.
const char *error_mlstr = "error\0erreur\0erro\0Ошибка\0";
And for this, you want a string table abstraction. C gives you all the tools you need to write proper ADTs; why do so many C programmers persist in trying to do everything without such help?
(
Log in to post comments)