summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/sqlite_statement.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2009-05-19 19:16:05 +0000
committerIlia Alshanetsky <iliaa@php.net>2009-05-19 19:16:05 +0000
commit1a39a2d3d3bc3a33c87299d4c37d972caf66bed9 (patch)
treeab64c94d8d9e5e567a5737cf473afa3252f72ff8 /ext/pdo_sqlite/sqlite_statement.c
parent761422a4a79b6fb8d5d4e0aa07a447d08f106ec2 (diff)
downloadphp-git-1a39a2d3d3bc3a33c87299d4c37d972caf66bed9.tar.gz
MFB: The \0 removal is only needed prior to 3.4.0
Diffstat (limited to 'ext/pdo_sqlite/sqlite_statement.c')
-rw-r--r--ext/pdo_sqlite/sqlite_statement.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c
index 939edc4caf..3d70bf4b6a 100644
--- a/ext/pdo_sqlite/sqlite_statement.c
+++ b/ext/pdo_sqlite/sqlite_statement.c
@@ -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);