diff options
Diffstat (limited to 'lib/libsqlite3')
-rw-r--r-- | lib/libsqlite3/tool/lemon.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libsqlite3/tool/lemon.c b/lib/libsqlite3/tool/lemon.c index c3e612b068e..0b41bdc44b7 100644 --- a/lib/libsqlite3/tool/lemon.c +++ b/lib/libsqlite3/tool/lemon.c @@ -1546,7 +1546,7 @@ int main(int argc, char **argv) /* ** Return a pointer to the next structure in the linked list. */ -#define NEXT(A) (*(char**)(((unsigned long)A)+offset)) +#define NEXT(A) (*(char**)(((char*)A)+offset)) /* ** Inputs: @@ -4025,8 +4025,9 @@ void ReportHeader(struct lemon *lemp) sprintf(pattern,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i); if( strcmp(line,pattern) ) break; } + int eof = fgetc(in); fclose(in); - if( i==lemp->nterminal ){ + if( i==lemp->nterminal && eof == EOF ){ /* No change in the file. Don't rewrite it. */ return; } |