summaryrefslogtreecommitdiffstats
path: root/sys/ddb/db_output.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1994-10-30 20:55:44 +0000
committerbde <bde@FreeBSD.org>1994-10-30 20:55:44 +0000
commit423f808042c2237d4bdd7f71355eb4cf487bbd8d (patch)
treede994457a1313b42d6565cd06b5808b5e582effa /sys/ddb/db_output.c
parent44b50c9d21c7baef63f0f3682ff4e657bd533898 (diff)
downloadFreeBSD-src-423f808042c2237d4bdd7f71355eb4cf487bbd8d.zip
FreeBSD-src-423f808042c2237d4bdd7f71355eb4cf487bbd8d.tar.gz
Print "(null)" instead of crashing for null strings. Null names are
often generated for stack traces. Now inspection of unmapped addresses no longer panics the system.
Diffstat (limited to 'sys/ddb/db_output.c')
-rw-r--r--sys/ddb/db_output.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c
index 5fa5cb8..cc70b63 100644
--- a/sys/ddb/db_output.c
+++ b/sys/ddb/db_output.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_output.c,v 1.8 1994/08/27 16:14:09 davidg Exp $
+ * $Id: db_output.c,v 1.9 1994/09/27 03:34:54 phk Exp $
*/
/*
@@ -282,6 +282,8 @@ reswitch: switch (ch = *(u_char *)fmt++) {
break;
case 's':
p = va_arg(ap, char *);
+ if (p == NULL)
+ p = "(null)";
width -= strlen (p);
if (!ladjust && width > 0)
while (width--)
OpenPOWER on IntegriCloud