Antony Dovgal ha scritto: > On 08.05.2009 03:29, Matteo Beccati wrote: >> #ifdef HAVE_CONFIG_H >> #include "config.h" >> @@ -265,11 +265,6 @@ >> case SQLITE3_TEXT: >> *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--; >> - } >> return 1; > > It doesn't look like no-op to me, but it's not clear what's being decremented. > I'd say it should do (*len)-- if the comment in sqlite3.h is correct.
By "no-op" I meant that it's not doing anything in a broader context, i.e. it's not decreasing the length integer used by the caller function. I've been pointed to the compiler warning (see bug topic of http://bugs.php.net/bug.php?id=48185) and propery fixed it. When I ran the test suite lots of test cases were failing because the output was truncated. I think that this by itself is the proof that sqlite3_column_bytes() is not including the NULL terminator. To be sure I've also checked sqlite3.h and couldn't find any reference to that behaviour. The comment is wrong and the code is not doing what the comment tells, so I thought that a clean up was required, both for consistency and to fix the compiler warning. Cheers -- M. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php