From 2a7a1a215da34420a8077fe0e774dd799211d16a Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 22 Oct 2014 16:34:50 -0500 Subject: [PATCH] wmifs: Avoid NULL arguments to strdup. This prevents several compiler warnings such as the following: wmifs.c:422:3: warning: null argument where non-null required (argument 1) [-Wnonnull] left_action = strdup(LEFT_ACTION); ^ --- wmifs/wmifs/wmifs.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/wmifs/wmifs/wmifs.c b/wmifs/wmifs/wmifs.c index 2d04aa0..18194ae 100644 --- a/wmifs/wmifs/wmifs.c +++ b/wmifs/wmifs/wmifs.c @@ -223,10 +223,10 @@ #define stats_ptr stats.p.FIXME #endif -/* Fill in the hardcoded actions */ -#define LEFT_ACTION (NULL) -#define MIDDLE_ACTION (NULL) -#define RIGHT_ACTION (NULL) +/* Fill in and uncomment the hardcoded actions */ +/* #define LEFT_ACTION (NULL) */ +/* #define MIDDLE_ACTION (NULL) */ +/* #define RIGHT_ACTION (NULL) */ /* Defines voor alle coordinate */ @@ -418,12 +418,15 @@ void wmifs_routine(int argc, char **argv) } } - if (LEFT_ACTION) - left_action = strdup(LEFT_ACTION); - if (MIDDLE_ACTION) - middle_action = strdup(MIDDLE_ACTION); - if (RIGHT_ACTION) - right_action = strdup(RIGHT_ACTION); +#ifdef LEFT_ACTION + left_action = strdup(LEFT_ACTION); +#endif +#ifdef MIDDLE_ACTION + middle_action = strdup(MIDDLE_ACTION); +#endif +#ifdef RIGHT_ACTION + right_action = strdup(RIGHT_ACTION); +#endif /* Scan throught the .rc files */ parse_rcfile("/etc/wmifsrc", wmifs_keys);