diff options
author | 2012-05-22 09:10:09 +0000 | |
---|---|---|
committer | 2012-05-22 09:10:09 +0000 | |
commit | 832605ce8f7de390b70f289c22e85d412743a1d3 (patch) | |
tree | 7dd6714762d7129530129a054dcdb6eefaafb28d /lib/libsqlite3/tool/lemon.c | |
parent | Move some common code to repeat spaces into a function. (diff) | |
download | wireguard-openbsd-832605ce8f7de390b70f289c22e85d412743a1d3.tar.xz wireguard-openbsd-832605ce8f7de390b70f289c22e85d412743a1d3.zip |
lemon bug: checking lines is not enough, we have to be sure we're at the
end of file to make sure the include file hasn't been altered.
problem reported by landry@, deraadt@
Diffstat (limited to 'lib/libsqlite3/tool/lemon.c')
-rw-r--r-- | lib/libsqlite3/tool/lemon.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libsqlite3/tool/lemon.c b/lib/libsqlite3/tool/lemon.c index 5d969953354..0b41bdc44b7 100644 --- a/lib/libsqlite3/tool/lemon.c +++ b/lib/libsqlite3/tool/lemon.c @@ -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; } |