# HG changeset patch # User Rob Landley # Date 1383420294 18000 # Node ID 1bca28705a87e75c8ffb43989bca7d092fd94d6d # Parent e11684e3bbc5bcfe64f9b8f94a9a94a4d5218297 Give xstrncpy() a more informative error message. diff -r e11684e3bbc5 -r 1bca28705a87 lib/xwrap.c --- 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); }