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);
   ^
This commit is contained in:
Doug Torrance 2014-10-22 16:34:50 -05:00 committed by Carlos R. Mafra
parent 3b4c28b9bc
commit 2a7a1a215d

View file

@ -223,10 +223,10 @@
#define stats_ptr stats.p.FIXME #define stats_ptr stats.p.FIXME
#endif #endif
/* Fill in the hardcoded actions */ /* Fill in and uncomment the hardcoded actions */
#define LEFT_ACTION (NULL) /* #define LEFT_ACTION (NULL) */
#define MIDDLE_ACTION (NULL) /* #define MIDDLE_ACTION (NULL) */
#define RIGHT_ACTION (NULL) /* #define RIGHT_ACTION (NULL) */
/* Defines voor alle coordinate */ /* Defines voor alle coordinate */
@ -418,12 +418,15 @@ void wmifs_routine(int argc, char **argv)
} }
} }
if (LEFT_ACTION) #ifdef LEFT_ACTION
left_action = strdup(LEFT_ACTION); left_action = strdup(LEFT_ACTION);
if (MIDDLE_ACTION) #endif
middle_action = strdup(MIDDLE_ACTION); #ifdef MIDDLE_ACTION
if (RIGHT_ACTION) middle_action = strdup(MIDDLE_ACTION);
right_action = strdup(RIGHT_ACTION); #endif
#ifdef RIGHT_ACTION
right_action = strdup(RIGHT_ACTION);
#endif
/* Scan throught the .rc files */ /* Scan throught the .rc files */
parse_rcfile("/etc/wmifsrc", wmifs_keys); parse_rcfile("/etc/wmifsrc", wmifs_keys);