summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2002-11-10 02:48:22 +0000
committerfoobar <sniper@php.net>2002-11-10 02:48:22 +0000
commit609992baeb229c32697dfb5df62aea67e3c2657b (patch)
tree31ca648351fd91a84c0ec08c6295cf787ffbb721 /main/main.c
parentee0ad3c81a5531500905f56f5666bcb61a4d53b1 (diff)
downloadphp-git-609992baeb229c32697dfb5df62aea67e3c2657b.tar.gz
ws fixes
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/main/main.c b/main/main.c
index 54b75b1d05..e0b4ddd0b0 100644
--- a/main/main.c
+++ b/main/main.c
@@ -406,7 +406,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
char *buffer = NULL, *docref_buf = NULL, *ref = NULL, *target = NULL;
char *docref_target = "", *docref_root = "";
char *function, *p;
- int buffer_len = 0;
+ int buffer_len = 0;
buffer_len = vspprintf(&buffer, 0, format, args);
if (buffer) {
@@ -457,27 +457,29 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
} else {
php_error(type, "%s(%s) [%s%s%s]: %s", get_active_function_name(TSRMLS_C), params, docref_root, docref, docref_target, buffer);
}
- if (target)
+ if (target) {
efree(target);
- } else {
+ }
+ } else {
docref = get_active_function_name(TSRMLS_C);
if (!docref)
docref = "Unknown";
php_error(type, "%s(%s): %s", docref, params, buffer);
}
- if (PG(track_errors) && EG(active_symbol_table)) {
- pval *tmp;
- ALLOC_ZVAL(tmp);
- INIT_PZVAL(tmp);
- Z_STRVAL_P(tmp) = (char *) estrndup(buffer, buffer_len);
- Z_STRLEN_P(tmp) = buffer_len;
- Z_TYPE_P(tmp) = IS_STRING;
- zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(pval *), NULL);
- }
+
+ if (PG(track_errors) && EG(active_symbol_table)) {
+ zval *tmp;
+ ALLOC_ZVAL(tmp);
+ INIT_PZVAL(tmp);
+ Z_STRVAL_P(tmp) = (char *) estrndup(buffer, buffer_len);
+ Z_STRLEN_P(tmp) = buffer_len;
+ Z_TYPE_P(tmp) = IS_STRING;
+ zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(pval *), NULL);
+ }
efree(buffer);
if (docref_buf) {
efree(docref_buf);
- }
+ }
} else {
php_error(E_ERROR, "%s(%s): Out of memory", get_active_function_name(TSRMLS_C), params);
}