Skip to content

Commit d9eb68b

Browse files
committed
use ZSTR_LEN, ZSTR_VAL where possible, refs #180
1 parent 97a9a2c commit d9eb68b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

v8js.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,25 @@ static ZEND_INI_MH(v8js_OnUpdateV8Flags) /* {{{ */
5959
free(v8js_process_globals.v8_flags);
6060
v8js_process_globals.v8_flags = NULL;
6161
}
62-
if (!new_value->val[0]) {
62+
if (!ZSTR_VAL(new_value)[0]) {
6363
return FAILURE;
6464
}
65-
v8js_process_globals.v8_flags = zend_strndup(new_value->val, new_value->len);
65+
v8js_process_globals.v8_flags = zend_strndup(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
6666
}
6767

6868
return SUCCESS;
6969
}
7070

7171
static bool v8js_ini_to_bool(const zend_string *new_value) /* {{{ */
7272
{
73-
if (new_value->len == 2 && strcasecmp("on", new_value->val) == 0) {
73+
if (ZSTR_LEN(new_value) == 2 && strcasecmp("on", ZSTR_VAL(new_value)) == 0) {
7474
return true;
75-
} else if (new_value->len == 3 && strcasecmp("yes", new_value->val) == 0) {
75+
} else if (ZSTR_LEN(new_value) == 3 && strcasecmp("yes", ZSTR_VAL(new_value)) == 0) {
7676
return true;
77-
} else if (new_value->len == 4 && strcasecmp("true", new_value->val) == 0) {
77+
} else if (ZSTR_LEN(new_value) == 4 && strcasecmp("true", ZSTR_VAL(new_value)) == 0) {
7878
return true;
7979
} else {
80-
return (bool) atoi(new_value->val);
80+
return (bool) atoi(ZSTR_VAL(new_value));
8181
}
8282
}
8383
/* }}} */

0 commit comments

Comments
 (0)