w9wm (0.4.2-7) 10_compiler_warnings.diff

Summary

 error.c  |    1 +
 manage.c |    1 +
 menu.c   |   10 +++++-----
 3 files changed, 7 insertions(+), 5 deletions(-)

    
download this patch

Patch contents

Description: Prevent compiler warnings.
 Missing inclusions of stdlib.h and string.h, needed for
 undeclared prototypes of exit() and strcmp().
 .
 Incorrect sentinel marker for execlp().
Forwarded: no
Author: Mats Erik Andersson <mats.andersson@gisladisker.se>
Last-Update: 2009-12-31
diff -Naurp w9wm-0.4.2.orig/error.c w9wm-0.4.2/error.c
--- w9wm-0.4.2.orig/error.c
+++ w9wm-0.4.2/error.c
@@ -1,5 +1,6 @@
 /* Copyright (c) 1994 David Hogan, see README for licence details */
 #include <stdio.h>
+#include <stdlib.h>
 #include <X11/X.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
diff -Naurp w9wm-0.4.2.orig/manage.c w9wm-0.4.2/manage.c
--- w9wm-0.4.2.orig/manage.c
+++ w9wm-0.4.2/manage.c
@@ -1,6 +1,7 @@
 /* Copyright (c) 1994 David Hogan, 2000 Benjamin Drieu, see README for licence details */
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <X11/X.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
diff -Naurp w9wm-0.4.2.orig/menu.c w9wm-0.4.2/menu.c
--- w9wm-0.4.2.orig/menu.c
+++ w9wm-0.4.2/menu.c
@@ -1,7 +1,7 @@
 /* Copyright (c) 1994 David Hogan, 2000 Benjamin Drieu, see README for licence details */
 #include <stdio.h>
 #include <unistd.h>
-#include <unistd.h>
+#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <X11/X.h>
@@ -102,7 +102,7 @@ XButtonEvent *e;
 		if (fork() == 0) {
 		  if (fork() == 0) {
 		    close(ConnectionNumber(dpy));
-		    execlp(progsnames[n], progsnames[n], 0);
+		    execlp(progsnames[n], progsnames[n], (char *) NULL);
 		    exit(1);
 		  }
 		  exit(0);
@@ -261,12 +261,12 @@ spawn()
         if (fork() == 0) {
             close(ConnectionNumber(dpy));
             if (termprog != NULL) {
-                execl(shell, shell, "-c", termprog, 0);
+                execl(shell, shell, "-c", termprog, (char *) NULL);
                 fprintf(stderr, "9wm: exec %s", shell);
                 perror(" failed");
             }
-            execlp("xterm", "xterm", "-ut", 0);
-            execlp("9term", "9term", "-9wm", 0);
+            execlp("xterm", "xterm", "-ut", (char *) NULL);
+            execlp("9term", "9term", "-9wm", (char *) NULL);
             perror("9wm: exec 9term/xterm failed");
             exit(1);
         }