[Pkg-wmaker-commits] [wmifs] 21/118: wmifs: Avoid NULL arguments to strdup.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 27 02:37:48 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmifs.

commit e2dc6e2d7358e89ec9caa947c850f34f15aded8d
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Wed Oct 22 16:34:50 2014 -0500

    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.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/wmifs/wmifs.c b/wmifs/wmifs.c
index 2d04aa0..18194ae 100644
--- a/wmifs/wmifs.c
+++ b/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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmifs.git



More information about the Pkg-wmaker-commits mailing list