summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-05-17 17:55:37 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-05-17 17:55:37 +0000
commit8ab895baf00686a3d766154d0a07aae92e4475f9 (patch)
treeddbc5e4f265645b1e849560e33ec933c357cc319 /Src
parent63b0ca8f378f0c1aa2f3e8858e4e2ea91d645218 (diff)
downloadzsh-8ab895baf00686a3d766154d0a07aae92e4475f9.tar.gz
zsh-8ab895baf00686a3d766154d0a07aae92e4475f9.tar.xz
zsh-8ab895baf00686a3d766154d0a07aae92e4475f9.zip
25057: better debug error on memory failure
Diffstat (limited to 'Src')
-rw-r--r--Src/mem.c2
-rw-r--r--Src/utils.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/Src/mem.c b/Src/mem.c
index 448c4aad9..88cd6247a 100644
--- a/Src/mem.c
+++ b/Src/mem.c
@@ -958,7 +958,7 @@ malloc(MALLOC_ARG_T size)
 	n = (size + M_HSIZE + M_ALLOC + m_pgsz - 1) & ~(m_pgsz - 1);
 
 	if (((char *)(m = (struct m_hdr *)sbrk(n))) == ((char *)-1)) {
-	    DPUTS(1, "MEM: allocation error at sbrk.");
+	    DPUTS1(1, "MEM: allocation error at sbrk, size %L.", n);
 	    unqueue_signals();
 	    return NULL;
 	}
diff --git a/Src/utils.c b/Src/utils.c
index a1a97d182..2873e63dc 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -255,6 +255,7 @@ zerrmsg(FILE *file, const char *fmt, va_list ap)
 {
     const char *str;
     int num;
+    long lnum;
 #ifdef HAVE_STRERROR_R
 #define ERRBUFSIZE (80)
     int olderrno;
@@ -286,6 +287,12 @@ zerrmsg(FILE *file, const char *fmt, va_list ap)
 		nicezputs(s, file);
 		break;
 	    }
+#ifdef DEBUG
+	    case 'L':
+		lnum = va_arg(ap, long);
+		fprintf(file, "%ld", lnum);
+		break;
+#endif
 	    case 'd':
 		num = va_arg(ap, int);
 		fprintf(file, "%d", num);