Fix resizing the string buffer.

Issue=117
TRAC #15793
Signed-off-by: Daniel Koch
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@605 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/preprocessor/atom.c b/src/compiler/preprocessor/atom.c
index c5636b7..b4a7761 100644
--- a/src/compiler/preprocessor/atom.c
+++ b/src/compiler/preprocessor/atom.c
@@ -182,12 +182,13 @@
     char *str;
 
     len = (int) strlen(s);
-    if (stable->nextFree + len + 1 >= stable->size) {
+    while (stable->nextFree + len + 1 >= stable->size) {
         assert(stable->size < 1000000);
         str = (char *) malloc(stable->size*2);
         memcpy(str, stable->strings, stable->size);
         free(stable->strings);
         stable->strings = str;
+        stable->size = stable->size*2;
     }
     loc = stable->nextFree;
     strcpy(&stable->strings[loc], s);