diff options
author | Rob Landley <rob@landley.net> | 2013-11-02 14:24:54 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2013-11-02 14:24:54 -0500 |
commit | 3704f826b42d65e9d1da3c4f4084902d32eaba3a (patch) | |
tree | ec06b3328ed9381384c24dbab3cbafafb8627ad3 | |
parent | 98c322e881c6ab8d4f54c23feb1a106c23673640 (diff) | |
download | toybox-3704f826b42d65e9d1da3c4f4084902d32eaba3a.tar.gz |
Give xstrncpy() a more informative error message.
-rw-r--r-- | lib/xwrap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c index fdd2db47..98b4300e 100644 --- a/lib/xwrap.c +++ b/lib/xwrap.c @@ -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); } |