]> granicus.if.org Git - php/commitdiff
Changed to check for error with the new function that returns null if error is set
authorDaniel Persson <daniel.persson@textalk.se>
Mon, 7 Sep 2015 20:15:52 +0000 (22:15 +0200)
committerAnatol Belski <ab@php.net>
Fri, 8 Apr 2016 10:31:19 +0000 (12:31 +0200)
ext/intl/uchar/uchar.c

index 755a6c9acb3ff48a8d70ad48ea87e327233fb326..266c62821b15d9d37b4e1a3c374e88bedefce0e9 100644 (file)
@@ -241,7 +241,7 @@ IC_METHOD(charName) {
 
        if ((zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &zcp, &nameChoice) == FAILURE) ||
            (convert_cp(&cp, zcp) == FAILURE)) {
-               return;
+               RETURN_NULL();
        }
 
        buffer_len = u_charName(cp, (UCharNameChoice)nameChoice, NULL, 0, &error);
@@ -250,7 +250,7 @@ IC_METHOD(charName) {
        buffer_len = u_charName(cp, (UCharNameChoice)nameChoice, ZSTR_VAL(buffer), ZSTR_LEN(buffer) + 1, &error);
        if (U_FAILURE(error)) {
                zend_string_free(buffer);
-               INTL_CHECK_STATUS(error, "Failure getting character name");
+               INTL_CHECK_STATUS_OR_NULL(error, "Failure getting character name");
        }
        RETURN_NEW_STR(buffer);
 }
@@ -269,11 +269,11 @@ IC_METHOD(charFromName) {
        UErrorCode error = U_ZERO_ERROR;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &name, &name_len, &nameChoice) == FAILURE) {
-               return;
+               RETURN_NULL();
        }
 
        ret = u_charFromName((UCharNameChoice)nameChoice, name, &error);
-       INTL_CHECK_STATUS(error, NULL);
+       INTL_CHECK_STATUS_OR_NULL(error, NULL);
        RETURN_LONG(ret);
 }
 /* }}} */