Skip to content

Commit 70fb8c8

Browse files
author
Ilia Alshanetsky
committed
Revert faulty warning fix
1 parent 9e23042 commit 70fb8c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/pdo_sqlite/sqlite_statement.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsi
265265
case SQLITE3_TEXT:
266266
*ptr = (char*)sqlite3_column_text(S->stmt, colno);
267267
*len = sqlite3_column_bytes(S->stmt, colno);
268+
if (*len) {
269+
/* sqlite3.h says "the NUL terminator is included in the byte count for TEXT values" */
270+
*len--; /* do not remove this, even though it generates a warning */
271+
}
268272
return 1;
269273

270274
default:

0 commit comments

Comments
 (0)