diff options
Diffstat (limited to 'src/common.h')
| -rw-r--r-- | src/common.h | 3 |
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) |
