Keep unknown priorities from segfaulting.
authorMatt Kraai <kraai@debian.org>
Mon, 11 Dec 2000 20:13:37 +0000 (20:13 -0000)
committerMatt Kraai <kraai@debian.org>
Mon, 11 Dec 2000 20:13:37 +0000 (20:13 -0000)
sysklogd/syslogd.c
syslogd.c

index 7501380f607907e29809e54b3b617df08f788dca..a599b2113970234b836fcbc3ff9b2d19d0ecd06c 100644 (file)
@@ -143,7 +143,7 @@ static void logMessage (int pri, char *msg)
                                c_fac->c_name && !(c_fac->c_val == LOG_FAC(pri) << 3); c_fac++);
                for (c_pri = prioritynames;
                                c_pri->c_name && !(c_pri->c_val == LOG_PRI(pri)); c_pri++);
-               if (*c_fac->c_name == '\0' || *c_pri->c_name == '\0')
+               if (c_fac->c_name == NULL || c_pri->c_name == NULL)
                        snprintf(res, sizeof(res), "<%d>", pri);
                else
                        snprintf(res, sizeof(res), "%s.%s", c_fac->c_name, c_pri->c_name);
index 7501380f607907e29809e54b3b617df08f788dca..a599b2113970234b836fcbc3ff9b2d19d0ecd06c 100644 (file)
--- a/syslogd.c
+++ b/syslogd.c
@@ -143,7 +143,7 @@ static void logMessage (int pri, char *msg)
                                c_fac->c_name && !(c_fac->c_val == LOG_FAC(pri) << 3); c_fac++);
                for (c_pri = prioritynames;
                                c_pri->c_name && !(c_pri->c_val == LOG_PRI(pri)); c_pri++);
-               if (*c_fac->c_name == '\0' || *c_pri->c_name == '\0')
+               if (c_fac->c_name == NULL || c_pri->c_name == NULL)
                        snprintf(res, sizeof(res), "<%d>", pri);
                else
                        snprintf(res, sizeof(res), "%s.%s", c_fac->c_name, c_pri->c_name);