diff options
author | Nikos Mavroyanopoulos <nmav@php.net> | 2000-10-25 18:27:55 +0000 |
---|---|---|
committer | Nikos Mavroyanopoulos <nmav@php.net> | 2000-10-25 18:27:55 +0000 |
commit | e5b0945e4c6c41cd52bd35a445a8ce1a691940aa (patch) | |
tree | 84938beefa89c56907403a5bea4319b9acd20903 /ext/mcrypt | |
parent | 93232c70640938c55912b52278d1bb22c040ec3f (diff) | |
download | php-git-e5b0945e4c6c41cd52bd35a445a8ce1a691940aa.tar.gz |
Corrected some checks for errors.
Diffstat (limited to 'ext/mcrypt')
-rw-r--r-- | ext/mcrypt/mcrypt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 8147d8b4d7..e03dfeeb09 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -134,7 +134,7 @@ ZEND_GET_MODULE(mcrypt) nsize = nr * bsize #define MCRYPT_CHECK_TD_CPY \ - if(td == -1) { \ + if(td < 0) { \ php_error(E_WARNING, MCRYPT_FAILED); \ RETURN_FALSE; \ } \ @@ -613,7 +613,7 @@ PHP_FUNCTION(mcrypt_module_close) MCRYPT_GET_TD_ARG - if (mcrypt_module_close (td) == -1) { + if (mcrypt_module_close (td) < 0) { php_error (E_WARNING, "could not close module"); RETURN_FALSE } else { @@ -633,7 +633,7 @@ PHP_FUNCTION(mcrypt_generic_end) MCRYPT_GET_TD_ARG - if (mcrypt_generic_end (td) == -1) { + if (mcrypt_generic_end (td) < 0) { php_error (E_WARNING, "could not terminate encryption specifier"); RETURN_FALSE } @@ -1294,7 +1294,7 @@ static void php_mcrypt_do_crypt (char* cipher, zval **key, zval **data, char *mo memcpy (data_s, (*data)->value.str.val, (*data)->value.str.len); } - if (mcrypt_generic_init (td, key_s, use_key_length, iv_s) == -1) { + if (mcrypt_generic_init (td, key_s, use_key_length, iv_s) < 0) { php_error (E_ERROR, "generic_init failed"); } if (dencrypt == MCRYPT_ENCRYPT) |