From: Todd C. Miller Date: Wed, 13 Sep 1995 21:17:06 +0000 (+0000) Subject: don't include malloc.h if we include stdlib.h X-Git-Tag: SUDO_1_4_0~162 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=211361a5f0acb13c799168c8a5aa3c1ea1f9cb59;p=sudo don't include malloc.h if we include stdlib.h --- diff --git a/find_path.c b/find_path.c index 19b9fc04e..35b102e68 100644 --- a/find_path.c +++ b/find_path.c @@ -47,9 +47,9 @@ static char rcsid[] = "$Id$"; #ifdef HAVE_STRINGS_H #include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_MALLOC_H +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) #include -#endif /* HAVE_MALLOC_H */ +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #include #include #include diff --git a/interfaces.c b/interfaces.c index 1aa3f8a06..e3484c473 100644 --- a/interfaces.c +++ b/interfaces.c @@ -45,9 +45,9 @@ static char rcsid[] = "$Id$"; #ifdef HAVE_STRINGS_H #include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_MALLOC_H +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) #include -#endif /* HAVE_MALLOC_H */ +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #include #include #include diff --git a/parse.c b/parse.c index 9c4ab7a27..7d7964de5 100644 --- a/parse.c +++ b/parse.c @@ -40,9 +40,9 @@ static char rcsid[] = "$Id$"; #ifdef HAVE_STRINGS_H #include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_MALLOC_H +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) #include -#endif /* HAVE_MALLOC_H */ +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #include #include #include diff --git a/parse.lex b/parse.lex index 0918cdc4c..1f18edc32 100644 --- a/parse.lex +++ b/parse.lex @@ -31,12 +31,18 @@ static char rcsid[] = "$Id$"; #include "config.h" +#ifdef STDC_HEADERS +#include +#endif /* STDC_HEADERS */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_STRING_H #include #endif /* HAVE_STRING_H */ +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) +#include +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #include #include #include diff --git a/parse.yacc b/parse.yacc index d441d0f2d..1719a12f1 100644 --- a/parse.yacc +++ b/parse.yacc @@ -42,10 +42,10 @@ static char rcsid[] = "$Id$"; #include #ifdef HAVE_STRING_H #include -#endif -#ifdef HAVE_MALLOC_H +#endif /* HAVE_STRING_H */ +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) #include -#endif +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #ifdef HAVE_LSEARCH #include #endif /* HAVE_LSEARCH */ diff --git a/putenv.c b/putenv.c index dd2b989b0..bb93d2d25 100644 --- a/putenv.c +++ b/putenv.c @@ -40,9 +40,9 @@ static char rcsid[] = "$Id$"; #ifdef HAVE_STRINGS_H #include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_MALLOC_H +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) #include -#endif /* HAVE_MALLOC_H */ +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #include #include diff --git a/strdup.c b/strdup.c index b3994be24..97832d90c 100644 --- a/strdup.c +++ b/strdup.c @@ -48,9 +48,9 @@ static char rcsid[] = "$Id$"; #ifdef HAVE_STRINGS_H #include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_MALLOC_H +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) #include -#endif /* HAVE_MALLOC_H */ +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #include "compat.h" diff --git a/sudo.c b/sudo.c index bc303c935..5a535028a 100644 --- a/sudo.c +++ b/sudo.c @@ -71,9 +71,9 @@ static char rcsid[] = "$Id$"; #ifdef HAVE_STRINGS_H #include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_MALLOC_H +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) #include -#endif /* HAVE_MALLOC_H */ +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #include #include #include diff --git a/sudo_setenv.c b/sudo_setenv.c index 1d9ed1e39..a3315c5ca 100644 --- a/sudo_setenv.c +++ b/sudo_setenv.c @@ -35,9 +35,9 @@ static char rcsid[] = "$Id$"; #ifdef STDC_HEADERS #include #endif /* STDC_HEADERS */ -#ifdef HAVE_MALLOC_H +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) #include -#endif /* HAVE_MALLOC_H */ +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ diff --git a/testsudoers.c b/testsudoers.c index 460940c35..58e98492b 100644 --- a/testsudoers.c +++ b/testsudoers.c @@ -40,9 +40,9 @@ static char rcsid[] = "$Id$"; #ifdef HAVE_STRINGS_H #include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_MALLOC_H +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) #include -#endif /* HAVE_MALLOC_H */ +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #include #include #include diff --git a/visudo.c b/visudo.c index 27ece4d53..7b8191ca1 100644 --- a/visudo.c +++ b/visudo.c @@ -44,9 +44,9 @@ static char rcsid[] = "$Id$"; #ifdef HAVE_STRINGS_H #include #endif /* HAVE_STRINGS_H */ -#ifdef HAVE_MALLOC_H +#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) #include -#endif /* HAVE_MALLOC_H */ +#endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #include #include #include