From 148fdce82df1ac559c9d6e6735c7582103c5c1b0 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 16 Feb 2003 17:59:30 +0000 Subject: [PATCH] Reverted lld -> lld patch and added explanation as to why it should not be done. --- ext/mysqli/mysqli_api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.50.1