From: Roy T. Fielding Date: Thu, 4 May 2000 00:46:51 +0000 (+0000) Subject: Get rid of warning by including crypt.h when available. X-Git-Tag: APACHE_2_0_ALPHA_4~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66c90f61efdbec45af04634cee49e9c4fefa09c2;p=thirdparty%2Fapache%2Fhttpd.git Get rid of warning by including crypt.h when available. Make tmpnam stuff less complex. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85134 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/htpasswd.c b/support/htpasswd.c index 8175ce7c78d..d7c95317b8e 100644 --- a/support/htpasswd.c +++ b/support/htpasswd.c @@ -86,6 +86,10 @@ #include "ap_sha1.h" #include +#ifdef HAVE_CRYPT_H +#include +#endif + #ifdef WIN32 #include #define unlink _unlink @@ -124,6 +128,8 @@ static char *tempfilename; */ #ifdef L_tmpnam static char tname_buf[L_tmpnam]; +#else +static char *tname_buf = NULL; #endif /* @@ -526,12 +532,8 @@ int main(int argc, char *argv[]) * to add or update. Let's do it.. */ errno = 0; -#ifdef L_tmpnam tempfilename = tmpnam(tname_buf); -#else /* def L_tmpnam */ - tempfilename = tmpnam(NULL); -#endif /* def L_tmpnam */ - if ((tempfilename == NULL) || (strlen(tempfilename) == 0)) { + if ((tempfilename == NULL) || (*tempfilename == '\0')) { fprintf(stderr, "%s: unable to generate temporary filename\n", argv[0]); if (errno == 0) {