From 3704f826b42d65e9d1da3c4f4084902d32eaba3a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 2 Nov 2013 14:24:54 -0500 Subject: [PATCH] Give xstrncpy() a more informative error message. --- lib/xwrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.39.2