diff options
author | Vincent Sanders <vince@kyllikki.org> | 2017-03-05 12:11:48 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2017-03-05 12:11:48 +0000 |
commit | 718da3ffffd1181a0b5b2d590214bc408ca44117 (patch) | |
tree | e8183f3a1f31a930a0c46ce387ae766f6da99f50 /content | |
parent | ca942e9e26cbd28ad5003b0e8bf29a771aafed94 (diff) | |
download | netsurf-718da3ffffd1181a0b5b2d590214bc408ca44117.tar.gz netsurf-718da3ffffd1181a0b5b2d590214bc408ca44117.tar.bz2 |
make urldb internal parse macros less prone to control flow errors
fixes issue highlighted by coverity (CID 1361696)
Diffstat (limited to 'content')
-rw-r--r-- | content/urldb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/content/urldb.c b/content/urldb.c index 60944f7e5..c1c39c145 100644 --- a/content/urldb.c +++ b/content/urldb.c @@ -3796,7 +3796,7 @@ void urldb_load_cookies(const char *filename) if (!fp) return; -#define FIND_T { \ +#define FIND_T do { \ for (; *p && *p != '\t'; p++) \ ; /* do nothing */ \ if (p >= end) { \ @@ -3804,16 +3804,16 @@ void urldb_load_cookies(const char *filename) continue; \ } \ *p++ = '\0'; \ -} + } while(0) -#define SKIP_T { \ +#define SKIP_T do { \ for (; *p && *p == '\t'; p++) \ ; /* do nothing */ \ if (p >= end) { \ LOG("Overran input"); \ continue; \ } \ -} + } while(0) while (fgets(s, sizeof s, fp)) { char *p = s, *end = 0, |