On Thu, 6 Oct 2005, Rob Richards wrote:


Jani Taskinen wrote:

@@ -422,7 +422,7 @@
        tmp = *var;
        zval_copy_ctor(&tmp);
        convert_to_string(&tmp);
-       snprintf(tmp_buf, Z_STRLEN(tmp), WDDX_NUMBER, Z_STRVAL(tmp));
+ snprintf(tmp_buf, Z_STRLEN(tmp) + WDDX_NUMBER_LEN + 1, WDDX_NUMBER, Z_STRVAL(tmp));
        zval_dtor(&tmp);


        Why not like this:

snprintf(tmp_buf, Z_STRLEN(tmp) + sizeof(WDDX_NUMBER) + 1, WDDX_NUMBER, Z_STRVAL(tmp));

Adding extra define just for this seems a bit overkill. (and it is error prone too :)

You implying I cant count to 17? I do have toes you know :)

    Yeah, but you might not have all of them, how could I know? :)

Wasn't sure if it was looking for max number to write or maximum possible size there so err'd on side of caution. If max possible size, then what about just WDDX_BUF_LEN? (though not to be used in other spot).

    I don't feel that strong about this..just anticipated what Andi will say 
when
    he sees this patch. :)

    --Jani

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to