From: Ilia Alshanetsky Date: Sun, 16 Feb 2003 17:59:30 +0000 (+0000) Subject: Reverted lld -> lld patch and added explanation as to why it should not be X-Git-Tag: RELEASE_0_5~972 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=148fdce82df1ac559c9d6e6735c7582103c5c1b0;p=php Reverted lld -> lld patch and added explanation as to why it should not be done. --- diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 4dcc3d4f94..e37a120a00 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -643,7 +643,11 @@ PHP_FUNCTION(mysqli_fetch) my_ulonglong lval; memcpy (&lval, stmt->bind[i].buffer, sizeof(my_ulonglong)); if (lval != (long)lval) { - sprintf((char *)&tmp, "%llu", lval); + /* even though lval is declared as unsigned, the value + * may be negative. Therefor we cannot use %llu and must + * user %lld. + */ + sprintf((char *)&tmp, "%lld", lval); ZVAL_STRING(stmt->vars[i], tmp, 1); } else { ZVAL_LONG(stmt->vars[i], lval);