From: Ezra Peisach Date: Wed, 24 May 1995 11:17:21 +0000 (+0000) Subject: Check for stdlib.h and include if present or declare malloc, calloc and realloc X-Git-Tag: krb5-1.0-beta6~1940 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=906b47618991930952408135c76eb8460c9cd7b6;p=krb5.git Check for stdlib.h and include if present or declare malloc, calloc and realloc git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5857 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin.old/kpasswd/ChangeLog b/src/kadmin.old/kpasswd/ChangeLog index 83a3b8788..66fb3c803 100644 --- a/src/kadmin.old/kpasswd/ChangeLog +++ b/src/kadmin.old/kpasswd/ChangeLog @@ -1,3 +1,8 @@ +Wed May 24 07:12:08 1995 Ezra Peisach + + * configure.in: Check for stdlib.h. + + * kpasswd.c, networked.c: Include stdlib.h or declare malloc() Mon May 22 09:56:42 EDT 1995 Paul Park (pjpark@mit.edu) * Makefile.in - Install kpasswd as kpasswd_old. Manpage too. diff --git a/src/kadmin.old/kpasswd/configure.in b/src/kadmin.old/kpasswd/configure.in index 54b6bb7af..71b734e58 100644 --- a/src/kadmin.old/kpasswd/configure.in +++ b/src/kadmin.old/kpasswd/configure.in @@ -4,7 +4,7 @@ CONFIG_RULES AC_SET_BUILDTOP AC_PROG_INSTALL WITH_NETLIB -AC_HAVE_HEADERS(unistd.h) +AC_HAVE_HEADERS(unistd.h stdlib.h) CHECK_UTMP AC_FUNC_CHECK(getutent,AC_DEFINE(HAVE_GETUTENT)) ET_RULES diff --git a/src/kadmin.old/kpasswd/kpasswd.c b/src/kadmin.old/kpasswd/kpasswd.c index 5b1a182d0..1aa2e6685 100644 --- a/src/kadmin.old/kpasswd/kpasswd.c +++ b/src/kadmin.old/kpasswd/kpasswd.c @@ -42,6 +42,12 @@ #include "com_err.h" #include "adm_defs.h" +#ifdef HAVE_STDLIB_H +#include +#else +extern char *malloc(), *calloc(), *realloc(); +#endif + #ifndef MAXPATHLEN #define MAXPATHLEN 1024 #endif @@ -799,7 +805,7 @@ adm5_init_link(context, realm_of_server, local_socket) return(1); } /* connect to the server */ - if (connect(*local_socket, &remote_sin, sizeof(remote_sin)) < 0) { + if (connect(*local_socket, (struct sockaddr *) &remote_sin, sizeof(remote_sin)) < 0) { fprintf(stderr, "Cannot Connect to Socket\n"); close(*local_socket); return(1);