aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-10-29 20:14:03 +0100
committerMattias Andrée <maandree@operamail.com>2014-10-29 20:14:03 +0100
commit74d074597188cd6df28b777055ea6644272ace5c (patch)
tree8b14ed771cd030f1ebe35d2b81cf88a0f112b759
parentadd log-login-syslog (diff)
downloadcerberus-logging-74d074597188cd6df28b777055ea6644272ace5c.tar.gz
cerberus-logging-74d074597188cd6df28b777055ea6644272ace5c.tar.bz2
cerberus-logging-74d074597188cd6df28b777055ea6644272ace5c.tar.xz
fix warnings
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/common.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common.h b/src/common.h
index 086dd7f..5bcc315 100644
--- a/src/common.h
+++ b/src/common.h
@@ -28,6 +28,7 @@
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <stdlib.h>
@@ -44,7 +45,7 @@
#define LIST_ARGUMENTS X(action) X(username) X(ttyname) X(pid) X(hostname)
-#define streq(a, b) ((a == b) || (a && b && !strcmp(a, b)))
+#define streq(a, b) (((a == NULL) == (b == NULL)) || (a && b && !strcmp(a, b)))
#define xstrcpy(d, s) (s ? snprintf(d, sizeof(d) / sizeof(char), "%s", s) : 0)
#define xmemcpy(d, s) (s ? memcpy(d, s, sizeof(d)) : 0)