mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
The \0 removal is only needed prior to 3.4.0
This commit is contained in:
parent
37609844de
commit
5ec5e3b5f2
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue