]> granicus.if.org Git - php/commitdiff
Remove useless error check for bin2hex()
authorGeorge Peter Banyard <girgias@php.net>
Fri, 16 Aug 2019 20:44:21 +0000 (22:44 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 16 Aug 2019 21:53:53 +0000 (23:53 +0200)
And change prototype accordingly...

Closes GH-4550.

ext/standard/string.c

index 2928cd914e774e5fda35a58a6b23f259f0948325..c2f29baec77323759235847c87484c2de549ea72 100644 (file)
@@ -223,7 +223,7 @@ PHP_MSHUTDOWN_FUNCTION(localeconv)
 /* }}} */
 #endif
 
-/* {{{ proto string|false bin2hex(string data)
+/* {{{ proto string bin2hex(string data)
    Converts the binary representation of data to hex */
 PHP_FUNCTION(bin2hex)
 {
@@ -236,10 +236,6 @@ PHP_FUNCTION(bin2hex)
 
        result = php_bin2hex((unsigned char *)ZSTR_VAL(data), ZSTR_LEN(data));
 
-       if (!result) {
-               RETURN_FALSE;
-       }
-
        RETURN_STR(result);
 }
 /* }}} */