[PATCH] Fix MALLOC_CHECK_={5,7}

Jakub Jelinek jakub@redhat.com
Mon Feb 21 10:12:00 GMT 2005


Hi!

Since the Jan, 7th, malloc.c change malloc_printerr will print
just the program name instead of the error message, which isn't very
helpful.

2005-02-21  Jakub Jelinek  <jakub@redhat.com>

	* malloc/malloc.c (malloc_printerr): If MALLOC_CHECK_={5,7}, print
	the error message rather than program name.

--- libc/malloc/malloc.c.jj	2005-01-08 16:50:22.000000000 +0100
+++ libc/malloc/malloc.c	2005-02-21 10:58:05.269061553 +0100
@@ -5513,7 +5513,9 @@ extern char **__libc_argv attribute_hidd
 static void
 malloc_printerr(int action, const char *str, void *ptr)
 {
-  if (action & 1)
+  if ((action & 5) == 5)
+    __libc_message (action & 2, "%s\n", str);
+  else if (action & 1)
     {
       char buf[2 * sizeof (uintptr_t) + 1];
 
@@ -5523,8 +5525,7 @@ malloc_printerr(int action, const char *
 	*--cp = '0';
 
       __libc_message (action & 2,
-		      action & 4
-		      ? "%s\n" : "*** glibc detected *** %s: %s: 0x%s ***\n",
+		      "*** glibc detected *** %s: %s: 0x%s ***\n",
 		      __libc_argv[0] ?: "<unknown>", str, cp);
     }
   else if (action & 2)

	Jakub



More information about the Libc-hacker mailing list