diff options
author | Bruce Momjian | 2005-05-25 21:40:43 +0000 |
---|---|---|
committer | Bruce Momjian | 2005-05-25 21:40:43 +0000 |
commit | b492c3acccb3f8c97559ddfc2a25f25953a026d2 (patch) | |
tree | a9c42aa2bd86a88a849ffaa005766ffe3dee762a /contrib/tsearch2/query.c | |
parent | 13b729ca5267b58005f1ca9c873a86c2b0db3591 (diff) |
Add parentheses to macros when args are used in computations. Without
them, the executation behavior could be unexpected.
Diffstat (limited to 'contrib/tsearch2/query.c')
-rw-r--r-- | contrib/tsearch2/query.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/tsearch2/query.c b/contrib/tsearch2/query.c index ee4f779d58..eb45ba078e 100644 --- a/contrib/tsearch2/query.c +++ b/contrib/tsearch2/query.c @@ -680,12 +680,12 @@ typedef struct } INFIX; #define RESIZEBUF(inf,addsize) \ -while( ( inf->cur - inf->buf ) + addsize + 1 >= inf->buflen ) \ +while( ( (inf)->cur - (inf)->buf ) + (addsize) + 1 >= (inf)->buflen ) \ { \ - int4 len = inf->cur - inf->buf; \ - inf->buflen *= 2; \ - inf->buf = (char*) repalloc( (void*)inf->buf, inf->buflen ); \ - inf->cur = inf->buf + len; \ + int4 len = (inf)->cur - (inf)->buf; \ + (inf)->buflen *= 2; \ + (inf)->buf = (char*) repalloc( (void*)(inf)->buf, (inf)->buflen ); \ + (inf)->cur = (inf)->buf + len; \ } /* |