]> granicus.if.org Git - php/commitdiff
fix data type and warning
authorAnatol Belski <ab@php.net>
Fri, 25 Sep 2015 07:35:59 +0000 (09:35 +0200)
committerAnatol Belski <ab@php.net>
Fri, 25 Sep 2015 09:50:13 +0000 (11:50 +0200)
ext/standard/php_crypt_r.c

index bb88e0802771d0ca3aaa7b0c3dc554e86a059266..cce4737982c17caf43daaaa19d046a665c7fe64c 100644 (file)
@@ -127,7 +127,7 @@ to64(char *s, int32_t v, int n)
 char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
        HCRYPTPROV hCryptProv;
        HCRYPTHASH ctx, ctx1;
-       unsigned int i, pwl, sl;
+       DWORD i, pwl, sl;
        const BYTE magic_md5[4] = "$1$";
        const DWORD magic_md5_len = 3;
        DWORD        dwHashLen;
@@ -144,7 +144,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
                return NULL;
        }
 
-       pwl = (unsigned int) strlen(pw);
+       pwl = (DWORD) strlen(pw);
 
        /* Refine the salt first */
        sp = salt;
@@ -160,7 +160,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
        }
 
        /* get the length of the true salt */
-       sl = ep - sp;
+       sl = (DWORD)(ep - sp);
 
        /* Create an empty hash object. */
        if(!CryptCreateHash(hCryptProv, CALG_MD5, 0, 0, &ctx)) {