]> granicus.if.org Git - php/commitdiff
oops, the 0th byte should be set, too
authorSascha Schumann <sas@php.net>
Sun, 25 Apr 1999 21:50:24 +0000 (21:50 +0000)
committerSascha Schumann <sas@php.net>
Sun, 25 Apr 1999 21:50:24 +0000 (21:50 +0000)
ext/mcrypt/mcrypt.c

index 09d0c31dd2d9fa45ababa9c8969a3b96485b5e5f..65f16936373809a18d2d34dfb1bd54121a62b460 100644 (file)
@@ -188,8 +188,8 @@ PHP_FUNCTION(mcrypt_create_iv)
                read(fd, iv, i);
                close(fd);
        } else {
-               while(i--) {
-                       iv[i] = rand();
+               while(i) {
+                       iv[--i] = rand();
                }
        }
        RETURN_STRINGL(iv, size->value.lval, 0);