Don't loose information if no parameters were shown.

# Noticed by Sebatian Bergmann
This commit is contained in:
Marcus Boerger 2003-09-01 21:40:58 +00:00
parent bca0019d43
commit f03801bdd6
2 changed files with 8 additions and 2 deletions

View File

@ -264,8 +264,11 @@ static int _build_trace_string(zval **frame, int num_args, va_list args, zend_ha
TRACE_APPEND_KEY("function");
TRACE_APPEND_CHR('(');
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
int last_len = *len;
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp), (apply_func_args_t)_build_trace_args, 2, str, len);
*len -= 2; /* remove last ', ' */
if (last_len != *len) {
*len -= 2; /* remove last ', ' */
}
}
TRACE_APPEND_STR(")\n");
return ZEND_HASH_APPLY_KEEP;

View File

@ -264,8 +264,11 @@ static int _build_trace_string(zval **frame, int num_args, va_list args, zend_ha
TRACE_APPEND_KEY("function");
TRACE_APPEND_CHR('(');
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
int last_len = *len;
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp), (apply_func_args_t)_build_trace_args, 2, str, len);
*len -= 2; /* remove last ', ' */
if (last_len != *len) {
*len -= 2; /* remove last ', ' */
}
}
TRACE_APPEND_STR(")\n");
return ZEND_HASH_APPLY_KEEP;