]> granicus.if.org Git - php/commitdiff
Reverted lld -> lld patch and added explanation as to why it should not be
authorIlia Alshanetsky <iliaa@php.net>
Sun, 16 Feb 2003 17:59:30 +0000 (17:59 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 16 Feb 2003 17:59:30 +0000 (17:59 +0000)
done.

ext/mysqli/mysqli_api.c

index 4dcc3d4f948833e7e2406d96c37767a56a5f4e06..e37a120a00f3c1074df60edecd05ad33d75498a8 100644 (file)
@@ -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);