From: Sascha Schumann Date: Sun, 25 Apr 1999 21:50:24 +0000 (+0000) Subject: oops, the 0th byte should be set, too X-Git-Tag: BEFORE_PHP4_APACHE_MODULE_CHANGE~151 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c62ffa7e012b1eec4e102d4e80ca4923ba3dfe16;p=php oops, the 0th byte should be set, too --- diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 09d0c31dd2..65f1693637 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -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);