diff options
author | Derick Rethans <derick@php.net> | 2003-02-20 06:56:37 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2003-02-20 06:56:37 +0000 |
commit | ead7521e4d01d76979a8f155d518ed5247d9dbea (patch) | |
tree | c32d1184792a64211a7870eb6ec314d936960414 /ext/standard/md5.c | |
parent | 7ac81c2fbe05c92716555bf301735bee875fa5e8 (diff) | |
download | php-git-ead7521e4d01d76979a8f155d518ed5247d9dbea.tar.gz |
- No need to add the \0 ourselves, the estrndup in STRINGL takes care of
that for us.
Diffstat (limited to 'ext/standard/md5.c')
-rw-r--r-- | ext/standard/md5.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/standard/md5.c b/ext/standard/md5.c index 594a6e2303..1bde1f6809 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -49,7 +49,7 @@ PHP_NAMED_FUNCTION(php_if_md5) zend_bool raw_output = 0; char md5str[33]; PHP_MD5_CTX context; - unsigned char digest[17]; + unsigned char digest[16]; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) { return; @@ -60,7 +60,6 @@ PHP_NAMED_FUNCTION(php_if_md5) PHP_MD5Update(&context, arg, arg_len); PHP_MD5Final(digest, &context); if (raw_output) { - digest[16] = '\0'; RETURN_STRINGL(digest, 16, 1); } else { make_digest(md5str, digest); |