summaryrefslogtreecommitdiff
path: root/ext/wddx/wddx.c
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2005-10-06 18:48:19 +0000
committerRob Richards <rrichards@php.net>2005-10-06 18:48:19 +0000
commite1791bedd5084754de2b32b45c144d3d8b6a3758 (patch)
tree9c16e857d2ed2cfa707ea40bb6719c894004b4d4 /ext/wddx/wddx.c
parent6eaf1671b5a9f22a4a7f90b00b46c09b6837ba6a (diff)
downloadphp-git-e1791bedd5084754de2b32b45c144d3d8b6a3758.tar.gz
MFH: use sizeof instead of define
Diffstat (limited to 'ext/wddx/wddx.c')
-rw-r--r--ext/wddx/wddx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index 14da1cb952..2c1dd1dff0 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -422,7 +422,7 @@ static void php_wddx_serialize_number(wddx_packet *packet, zval *var)
tmp = *var;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
- snprintf(tmp_buf, Z_STRLEN(tmp) + WDDX_NUMBER_LEN + 1, WDDX_NUMBER, Z_STRVAL(tmp));
+ snprintf(tmp_buf, sizeof(tmp_buf), WDDX_NUMBER, Z_STRVAL(tmp));
zval_dtor(&tmp);
php_wddx_add_chunk(packet, tmp_buf);
@@ -624,8 +624,8 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name
if (name) {
name_esc = php_escape_html_entities(name, name_len, &name_esc_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
- tmp_buf = emalloc(name_esc_len + WDDX_VAR_S_LEN + 1);
- snprintf(tmp_buf, name_esc_len + WDDX_VAR_S_LEN + 1, WDDX_VAR_S, name_esc);
+ tmp_buf = emalloc(name_esc_len + sizeof(WDDX_VAR_S));
+ snprintf(tmp_buf, name_esc_len + sizeof(WDDX_VAR_S), WDDX_VAR_S, name_esc);
php_wddx_add_chunk(packet, tmp_buf);
efree(tmp_buf);
efree(name_esc);