projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98c322e
)
Give xstrncpy() a more informative error message.
author
Rob Landley
<rob@landley.net>
Sat, 2 Nov 2013 19:24:54 +0000
(14:24 -0500)
committer
Rob Landley
<rob@landley.net>
Sat, 2 Nov 2013 19:24:54 +0000
(14:24 -0500)
lib/xwrap.c
patch
|
blob
|
history
diff --git
a/lib/xwrap.c
b/lib/xwrap.c
index
fdd2db4
..
98b4300
100644
(file)
--- 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);
}