]> granicus.if.org Git - php/commitdiff
The \0 removal is only needed prior to 3.4.0
authorIlia Alshanetsky <iliaa@php.net>
Tue, 19 May 2009 19:15:18 +0000 (19:15 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 19 May 2009 19:15:18 +0000 (19:15 +0000)
ext/pdo_sqlite/sqlite_statement.c

index 82e4cb8f6c82e562ef1f51d1f0d53cb71fe5b0ab..2d32a0bf1f16fca9066880be6b695f0c31863ae3 100644 (file)
@@ -265,12 +265,13 @@ 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 SQLITE_VERSION_NUMBER < 3004000
                        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 */
+                               (*len)--;
                        }
+#endif
                        return 1;
-               
                default:
                        *ptr = (char*)sqlite3_column_text(S->stmt, colno);
                        *len = sqlite3_column_bytes(S->stmt, colno);