From: Ilia Alshanetsky Date: Tue, 19 May 2009 16:14:37 +0000 (+0000) Subject: MFB: Revert faulty warning fix X-Git-Tag: php-5.2.10RC1~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1989085325294aefc791e52931aa9cb2db5d5062;p=php MFB: Revert faulty warning fix --- diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c index 74e9686e9d..52e4b62bd6 100644 --- a/ext/pdo_sqlite/sqlite_statement.c +++ b/ext/pdo_sqlite/sqlite_statement.c @@ -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; } }