com php-src: Changed to check for error with the new function that returns null if error is set: ext/intl/uchar/uchar.c
| From: | Anatol Belski | Date: | Fri, 08 Apr 2016 10:31:19 +0000 |
| Subject: | com php-src: Changed to check for error with the new function that returns null if error is set: ext/intl/uchar/uchar.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91661@lists.php.net to get a copy of this message | ||
Commit: 0030fa322fd987da3a0b210837fd5d41e7559368
Author: Daniel Persson <daniel.persson@textalk.se> Mon, 7 Sep 2015 22:15:52 +0200
Committer: Anatol Belski <ab@php.net> Fri, 8 Apr 2016 12:31:19 +0200
Parents: e3b160bf864fa3b6b2bf938e62f18768032980ab
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0030fa322fd987da3a0b210837fd5d41e7559368
Log:
Changed to check for error with the new function that returns null if error is set
Changed paths:
M ext/intl/uchar/uchar.c
Diff:
diff --git a/ext/intl/uchar/uchar.c b/ext/intl/uchar/uchar.c
index 755a6c9..266c628 100644
--- a/ext/intl/uchar/uchar.c
+++ b/ext/intl/uchar/uchar.c
@@ -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);
}
/* }}} */