diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-05-16 10:23:04 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-05-16 10:23:26 -0700 |
commit | 34e0adabf0cd98eb4d1c4a929acf0b8238fcfbbc (patch) | |
tree | 5fd203cddf684289d982cc9b5e2a274461c5ecb7 /src | |
parent | 0da5dfc5bf682cebcb831d7f740ff58629a827e7 (diff) | |
download | grep-34e0adabf0cd98eb4d1c4a929acf0b8238fcfbbc.tar.gz |
grep: avoid nominal integer overflow
* src/dfa.c (add_utf8_anychar): Avoid signed integer overflow.
Although this works on all platforms we know about, strictly
speaking the behavior is undefined, and Sun C 5.8 warns about it.
Diffstat (limited to 'src')
-rw-r--r-- | src/dfa.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1630,7 +1630,7 @@ add_utf8_anychar (void) static const charclass utf8_classes[5] = { {0, 0, 0, 0, ~0, ~0, 0, 0}, /* 80-bf: non-lead bytes */ {~0, ~0, ~0, ~0, 0, 0, 0, 0}, /* 00-7f: 1-byte sequence */ - {0, 0, 0, 0, 0, 0, 0xfffffffcU, 0}, /* c2-df: 2-byte sequence */ + {0, 0, 0, 0, 0, 0, ~3, 0}, /* c2-df: 2-byte sequence */ {0, 0, 0, 0, 0, 0, 0, 0xffff}, /* e0-ef: 3-byte sequence */ {0, 0, 0, 0, 0, 0, 0, 0xff0000} /* f0-f7: 4-byte sequence */ }; |