From: hniksic Date: Fri, 3 Oct 2003 16:11:09 +0000 (-0700) Subject: [svn] Fix compilation problem on non-Gcc compilers. X-Git-Tag: v1.13~1629 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=87275db1362321fad756c00b21ba54e3b6b98ecf [svn] Fix compilation problem on non-Gcc compilers. --- diff --git a/src/ChangeLog b/src/ChangeLog index c65bd6e8..3b55ae25 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-10-03 Hrvoje Niksic + + * html-parse.c (convert_and_copy): Move variable declarations + before statements. + 2003-10-02 Gisle Vanem * mswindows.c (run_with_timeout): For Windows: Run the 'fun' in a diff --git a/src/html-parse.c b/src/html-parse.c index 16b88d0f..a5fab446 100644 --- a/src/html-parse.c +++ b/src/html-parse.c @@ -174,7 +174,7 @@ struct pool { already has room to accomodate SIZE bytes of data, this is a no-op. */ #define POOL_GROW(p, increase) \ - GROW_ARRAY ((p)->contents, (p)->size, (p)->tail + increase, \ + GROW_ARRAY ((p)->contents, (p)->size, (p)->tail + (increase), \ (p)->resized, char) /* Append text in the range [beg, end) to POOL. No zero-termination @@ -293,9 +293,11 @@ convert_and_copy (struct pool *pool, const char *beg, const char *end, int flags It's safe (and necessary) to grow the pool in advance because processing the entities can only *shorten* the string, it can never lengthen it. */ - POOL_GROW (pool, end - beg); const char *from = beg; - char *to = pool->contents + pool->tail; + char *to; + + POOL_GROW (pool, end - beg); + to = pool->contents + pool->tail; while (from < end) {