]> granicus.if.org Git - php/commitdiff
MFB: Revert faulty warning fix
authorIlia Alshanetsky <iliaa@php.net>
Tue, 19 May 2009 16:14:37 +0000 (16:14 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 19 May 2009 16:14:37 +0000 (16:14 +0000)
ext/pdo_sqlite/sqlite_statement.c

index 74e9686e9d728d9dd275c8236658965ab82bd7ac..52e4b62bd6c1959b48321a83b0cd991f0713a847 100644 (file)
@@ -244,6 +244,10 @@ static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsi
                default:
                        *ptr = (char*)sqlite3_column_text(S->stmt, colno);
                        *len = sqlite3_column_bytes(S->stmt, colno);
+                       if (*len) {
+                               /* sqlite3.h says "the NUL terminator is included in the byte count for TEXT values" */
+                               *len--; /* do not remove this, even though it generates a warning */
+                       }
                        return 1;
        }
 }