Mercurial > hg > toybox
diff lib/xwrap.c @ 1105:1bca28705a87 draft
Give xstrncpy() a more informative error message.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 02 Nov 2013 14:24:54 -0500 |
parents | 501fd74c028e |
children | c644f85444d0 |
line wrap: on
line diff
--- a/lib/xwrap.c Sat Nov 02 14:24:33 2013 -0500 +++ b/lib/xwrap.c Sat Nov 02 14:24:54 2013 -0500 @@ -12,7 +12,7 @@ // Strcpy with size checking: exit if there's not enough space for the string. void xstrncpy(char *dest, char *src, size_t size) { - if (strlen(src)+1 > size) error_exit("xstrcpy"); + if (strlen(src)+1 > size) error_exit("'%s' > %ld bytes", src, (long)size); strcpy(dest, src); }