diff options
author | drh <drh@noemail.net> | 2003-09-12 02:08:14 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2003-09-12 02:08:14 +0000 |
commit | 61b487d02a1ce8aebab61d367046be0f55a39f34 (patch) | |
tree | 04199865679075d5c23b89a8222c9095b350320e /src | |
parent | 9faae9411883b1ea0e1c6e0d83c1966fe718a4c7 (diff) | |
download | sqlite-61b487d02a1ce8aebab61d367046be0f55a39f34.tar.gz sqlite-61b487d02a1ce8aebab61d367046be0f55a39f34.zip |
The tokenizer should never return a negative size of the next token.
Ticket #453. (CVS 1098)
FossilOrigin-Name: 4fbca3ab09596c530da7c50657f3bc9140178dd5
Diffstat (limited to 'src')
-rw-r--r-- | src/tokenize.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/tokenize.c b/src/tokenize.c index 24433a07f..f99cb7131 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -15,7 +15,7 @@ ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.62 2003/09/06 22:18:08 drh Exp $ +** $Id: tokenize.c,v 1.63 2003/09/12 02:08:15 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -214,9 +214,8 @@ static const char isIdChar[] = { /* -** Return the length of the token that begins at z[0]. Return -** -1 if the token is (or might be) incomplete. Store the token -** type in *tokenType before returning. +** Return the length of the token that begins at z[0]. +** Store the token type in *tokenType before returning. */ static int sqliteGetToken(const unsigned char *z, int *tokenType){ int i; @@ -227,7 +226,6 @@ static int sqliteGetToken(const unsigned char *z, int *tokenType){ return i; } case '-': { - if( z[1]==0 ) return -1; if( z[1]=='-' ){ for(i=2; z[i] && z[i]!='\n'; i++){} *tokenType = TK_COMMENT; @@ -426,7 +424,6 @@ int sqliteRunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ pParse->sLastToken.dyn = 0; pParse->zTail = zSql; while( sqlite_malloc_failed==0 && zSql[i]!=0 ){ - assert( i>=0 ); pParse->sLastToken.z = &zSql[i]; assert( pParse->sLastToken.dyn==0 ); |