Skip to content

Commit

Permalink
Make mcrypt_enc_self_test() return value compatible with documentatio…
Browse files Browse the repository at this point in the history
…n and mcrypt _module_self_test()
  • Loading branch information
dsp committed May 18, 2008
1 parent d90f689 commit 472b883
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ext/mcrypt/mcrypt.c
Expand Up @@ -589,7 +589,12 @@ PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes)
PHP_FUNCTION(mcrypt_enc_self_test)
{
MCRYPT_GET_TD_ARG
RETURN_LONG(mcrypt_enc_self_test(pm->td));

if (mcrypt_enc_self_test(pm->td) == 0) {
RETURN_TRUE;
} else {
RETURN_FALSE;
}
}
/* }}} */

Expand Down
2 changes: 1 addition & 1 deletion ext/mcrypt/tests/mcrypt_enc_self_test.phpt
Expand Up @@ -7,4 +7,4 @@ mcrypt_enc_self_test
$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, '');
var_dump(mcrypt_enc_self_test($td));
--EXPECT--
int(0)
bool(true)

0 comments on commit 472b883

Please sign in to comment.