]> Zhao Yanbai Git Server - minix.git/commitdiff
make system server vprintf check for NULL
authorErik van der Kouwe <erik@minix3.org>
Mon, 4 Oct 2010 17:53:18 +0000 (17:53 +0000)
committerErik van der Kouwe <erik@minix3.org>
Mon, 4 Oct 2010 17:53:18 +0000 (17:53 +0000)
lib/libsys/vprintf.c

index 4a97efe42895e1baaff950d30aee9ca0048bcbd6..2749e400df9fa875ba7f35669d60fdb6153be10b 100644 (file)
@@ -142,6 +142,7 @@ int vprintf(const char *fmt, va_list argp)
                        /* A string.  The other cases will join in here. */
                case 's':
                        p= va_arg(argp, char *);
+                       if (!p) p = "(null)";
 
                string_length:
                        for (len= 0; p[len] != 0 && len < max; len++) {}