Skip to content

Commit e88c8cb

Browse files
committed
fixed macro names
1 parent 14b9658 commit e88c8cb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sapi/phpdbg/phpdbg_watch.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_
182182

183183
zend_hash_get_current_key_zval_ex(ht, &key, &position);
184184
if (Z_TYPE(key) == IS_STRING) {
185-
new_watch->name_in_parent = zend_strndup(Z_STRVAL(key), Z_STRLEN(key));
186-
new_watch->name_in_parent_len = Z_STRLEN(key);
185+
new_watch->name_in_parent = zend_strndup(Z_STRVAL(key), Z_STRSIZE(key));
186+
new_watch->name_in_parent_len = Z_STRSIZE(key);
187187
} else {
188188
new_watch->name_in_parent = NULL;
189-
new_watch->name_in_parent_len = asprintf(&new_watch->name_in_parent, "%ld", Z_LVAL(key));
189+
new_watch->name_in_parent_len = asprintf(&new_watch->name_in_parent, "%ld", Z_IVAL(key));
190190
}
191191

192192
new_watch->str = NULL;
@@ -238,7 +238,7 @@ static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch, zend_b
238238
if (Z_TYPE(key) == IS_STRING) {
239239
str_len = asprintf(&str, "%.*s%s%s%s", (int)watch->parent->str_len, watch->parent->str, Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"[":"->", phpdbg_get_property_key(Z_STRVAL(key)), Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"]":"");
240240
} else {
241-
str_len = asprintf(&str, "%.*s%s%li%s", (int)watch->parent->str_len, watch->parent->str, Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"[":"->", Z_LVAL(key), Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"]":"");
241+
str_len = asprintf(&str, "%.*s%s%li%s", (int)watch->parent->str_len, watch->parent->str, Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"[":"->", Z_IVAL(key), Z_TYPE_P(watch->parent->addr.zv) == IS_ARRAY?"]":"");
242242
}
243243

244244
if (zend_hash_find(&PHPDBG_G(watchpoints), str, str_len, (void **) &watchpoint) == SUCCESS) {
@@ -338,7 +338,7 @@ static int phpdbg_watchpoint_parse_input(char *input, size_t len, HashTable *par
338338
watch->flags = 0;
339339
zend_hash_get_current_key_zval_ex(parent, key, &position);
340340
convert_to_string(key);
341-
watch->str = malloc(i + Z_STRLEN_P(key) + 2);
341+
watch->str = malloc(i + Z_STRSIZE_P(key) + 2);
342342
watch->str_len = sprintf(watch->str, "%.*s%s%s", (int)i, input, phpdbg_get_property_key(Z_STRVAL_P(key)), input[len - 1] == ']'?"]":"");
343343
efree(key);
344344
watch->name_in_parent = zend_strndup(last_index, index_len);

0 commit comments

Comments
 (0)