]> granicus.if.org Git - sudo/commitdiff
don't include malloc.h if we include stdlib.h
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 13 Sep 1995 21:17:06 +0000 (21:17 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 13 Sep 1995 21:17:06 +0000 (21:17 +0000)
find_path.c
interfaces.c
parse.c
parse.lex
parse.yacc
putenv.c
strdup.c
sudo.c
sudo_setenv.c
testsudoers.c
visudo.c

index 19b9fc04e5603b18fe8b3df19787e0bf2ea7c4f1..35b102e683b9d652b34e00957759474449979c05 100644 (file)
@@ -47,9 +47,9 @@ static char rcsid[] = "$Id$";
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif /* HAVE_STRINGS_H */
-#ifdef HAVE_MALLOC_H
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
 #include <malloc.h>
-#endif /* HAVE_MALLOC_H */
+#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/param.h>
index 1aa3f8a06b0c41b04ba08fff257c73043bd7ad6c..e3484c473adba508bfe8f7ad0e67534cde25f874 100644 (file)
@@ -45,9 +45,9 @@ static char rcsid[] = "$Id$";
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif /* HAVE_STRINGS_H */
-#ifdef HAVE_MALLOC_H 
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
 #include <malloc.h>   
-#endif /* HAVE_MALLOC_H */ 
+#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
 #include <netdb.h>
 #include <errno.h>
 #include <sys/types.h>
diff --git a/parse.c b/parse.c
index 9c4ab7a278911fee706ece680704585351bc5ab6..7d7964de5862d306328292103f80063cbc9bcb2f 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -40,9 +40,9 @@ static char rcsid[] = "$Id$";
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif /* HAVE_STRINGS_H */
-#ifdef HAVE_MALLOC_H 
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
 #include <malloc.h>
-#endif /* HAVE_MALLOC_H */ 
+#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
 #include <ctype.h>
 #include <sys/param.h>
 #include <sys/types.h>
index 0918cdc4c44abf588ac1c2fdf3ce6943de4ad040..1f18edc32a34077ce5bd7eac01cd6a53c01f6882 100644 (file)
--- a/parse.lex
+++ b/parse.lex
@@ -31,12 +31,18 @@ static char rcsid[] = "$Id$";
 
 #include "config.h"
 
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif /* STDC_HEADERS */
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif /* HAVE_UNISTD_H */
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif /* HAVE_STRING_H */
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
+#include <malloc.h>
+#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/param.h>
index d441d0f2def6b763a920e2399f4a252a77c1bb63..1719a12f1a94cf7186a41b26abec0e9d96a49045 100644 (file)
@@ -42,10 +42,10 @@ static char rcsid[] = "$Id$";
 #include <netinet/in.h>
 #ifdef HAVE_STRING_H
 #include <string.h>
-#endif
-#ifdef HAVE_MALLOC_H
+#endif /* HAVE_STRING_H */
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
 #include <malloc.h>
-#endif
+#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
 #ifdef HAVE_LSEARCH
 #include <search.h>
 #endif /* HAVE_LSEARCH */
index dd2b989b01ec5e0ac5a6d9a6e0accf1f6f5f1298..bb93d2d252b1b71dea331b580450f4e5b417fafb 100644 (file)
--- a/putenv.c
+++ b/putenv.c
@@ -40,9 +40,9 @@ static char rcsid[] = "$Id$";
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif /* HAVE_STRINGS_H */
-#ifdef HAVE_MALLOC_H
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
 #include <malloc.h>
-#endif /* HAVE_MALLOC_H */
+#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
 #include <errno.h>
 #include <sys/param.h>
 
index b3994be245c3b45b7612ae1cbd3b89f5cdac6ab9..97832d90c412629b1079a0a02881fc29436f91a2 100644 (file)
--- a/strdup.c
+++ b/strdup.c
@@ -48,9 +48,9 @@ static char rcsid[] = "$Id$";
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif /* HAVE_STRINGS_H */
-#ifdef HAVE_MALLOC_H
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
 #include <malloc.h>
-#endif /* HAVE_MALLOC_H */
+#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
 
 #include "compat.h"
 
diff --git a/sudo.c b/sudo.c
index bc303c935582f9d9e92f80276afe370227967f75..5a535028a5e54c8f7f25c8cfac03bcf2c996769d 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -71,9 +71,9 @@ static char rcsid[] = "$Id$";
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif /* HAVE_STRINGS_H */
-#ifdef HAVE_MALLOC_H 
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
 #include <malloc.h>   
-#endif /* HAVE_MALLOC_H */ 
+#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
index 1d9ed1e392e63399d02f9ad025ef4b2114e1755e..a3315c5cab5f0c3375d6d174db8cb14a4b5db126 100644 (file)
@@ -35,9 +35,9 @@ static char rcsid[] = "$Id$";
 #ifdef STDC_HEADERS
 #include <stdlib.h>
 #endif /* STDC_HEADERS */
-#ifdef HAVE_MALLOC_H
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
 #include <malloc.h>
-#endif /* HAVE_MALLOC_H */
+#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif /* HAVE_UNISTD_H */
index 460940c358fadf1acb922e19510d9d5a988bf88d..58e98492b6164f464cfa5ebc1e53dad9797a7e89 100644 (file)
@@ -40,9 +40,9 @@ static char rcsid[] = "$Id$";
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif /* HAVE_STRINGS_H */
-#ifdef HAVE_MALLOC_H 
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
 #include <malloc.h>
-#endif /* HAVE_MALLOC_H */ 
+#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
 #include <ctype.h>
 #include <sys/param.h>
 #include <sys/types.h>
index 27ece4d53c53254f682ad065b7172b884d06ffe7..7b8191ca1a34ee9ca0cd7ecd13b82ef3932aa4c9 100644 (file)
--- a/visudo.c
+++ b/visudo.c
@@ -44,9 +44,9 @@ static char rcsid[] = "$Id$";
 #ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif /* HAVE_STRINGS_H */
-#ifdef HAVE_MALLOC_H
+#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
 #include <malloc.h>
-#endif /* HAVE_MALLOC_H */
+#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
 #include <ctype.h>
 #include <pwd.h>
 #include <signal.h>