]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
If we don't have a prototype for crypt() we shouldn't
authorJeff Trawick <trawick@apache.org>
Wed, 12 Apr 2006 01:58:08 +0000 (01:58 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 12 Apr 2006 01:58:08 +0000 (01:58 +0000)
be calling it.

Casting to the desired pointer return type hides the
truncation of the return value when sizeof(ptr) >
sizeof(int) and no prototype was included.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@393365 13f79535-47bb-0310-9956-ffa450edef68

support/htdbm.c
support/htpasswd.c

index 84ab8f07e9af765dfe151ed124efc4a5704264cf..07057e773099a0b945a4cab5bf70b09a28ff11a9 100644 (file)
@@ -321,7 +321,7 @@ static apr_status_t htdbm_make(htdbm_t *htdbm)
             (void) srand((int) time((time_t *) NULL));
             to64(&salt[0], rand(), 8);
             salt[8] = '\0';
-            apr_cpystrn(cpw, (char *)crypt(htdbm->userpass, salt), sizeof(cpw) - 1);
+            apr_cpystrn(cpw, crypt(htdbm->userpass, salt), sizeof(cpw) - 1);
             fprintf(stderr, "CRYPT is now deprecated, use MD5 instead!\n");
 #endif
         default:
index 588c892ed1e232712d6e4810aa78233b109ee002..19ad32b9518e8440e3fb683f85c5e3b165844e07 100644 (file)
@@ -182,7 +182,7 @@ static int mkrecord(char *user, char *record, apr_size_t rlen, char *passwd,
         to64(&salt[0], rand(), 8);
         salt[8] = '\0';
 
-        apr_cpystrn(cpw, (char *)crypt(pw, salt), sizeof(cpw) - 1);
+        apr_cpystrn(cpw, crypt(pw, salt), sizeof(cpw) - 1);
         break;
 #endif
     }