- hexlen is 2*digestlen

This commit is contained in:
Michael Wallner 2005-11-22 19:23:55 +00:00
parent 4c61cf6f4c
commit 99c8d42a7b
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ php_hash_ops php_hash_md5_ops = {
PHP_HASH_API void make_digest(char *md5str, unsigned char *digest)
{
php_hash_bin2hex(md5str, digest, 16);
md5str[16] = '\0';
md5str[32] = '\0';
}
/* {{{ proto string md5(string str, [ bool raw_output])

View File

@ -90,7 +90,7 @@ php_hash_ops php_hash_sha1_ops = {
PHP_HASH_API void make_sha1_digest(char *sha1str, unsigned char *digest)
{
php_hash_bin2hex(sha1str, digest, 20);
sha1str[20] = '\0';
sha1str[40] = '\0';
}
/* {{{ proto string sha1(string str [, bool raw_output])