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

index ea94eb29b248847fa599c9f6f7634e00c7e98c1e..82e4cb8f6c82e562ef1f51d1f0d53cb71fe5b0ab 100644 (file)
@@ -265,6 +265,10 @@ static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsi
                case SQLITE3_TEXT:
                        *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;
                
                default: