summaryrefslogtreecommitdiff
path: root/contrib/gcc/cppmacro.c
diff options
context:
space:
mode:
authorAlexander Kabaev <kan@FreeBSD.org>2002-10-10 04:40:18 +0000
committerAlexander Kabaev <kan@FreeBSD.org>2002-10-10 04:40:18 +0000
commit423134a002b5ea83b68270c33130754764fa5f4c (patch)
treef505e08c93c8d3d8e51f5dac050b459cce4d4ae2 /contrib/gcc/cppmacro.c
parent10882802bbbce9d52009a76b83e5508d388df999 (diff)
Notes
Diffstat (limited to 'contrib/gcc/cppmacro.c')
-rw-r--r--contrib/gcc/cppmacro.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/gcc/cppmacro.c b/contrib/gcc/cppmacro.c
index c85ac21cce14..70e52fda6e86 100644
--- a/contrib/gcc/cppmacro.c
+++ b/contrib/gcc/cppmacro.c
@@ -348,6 +348,12 @@ stringify_arg (pfile, arg)
}
/* Commit the memory, including NUL, and return the token. */
+ if ((size_t) (BUFF_LIMIT (pfile->u_buff) - dest) < 1)
+ {
+ size_t len_so_far = dest - BUFF_FRONT (pfile->u_buff);
+ _cpp_extend_buff (pfile, &pfile->u_buff, 1);
+ dest = BUFF_FRONT (pfile->u_buff) + len_so_far;
+ }
len = dest - BUFF_FRONT (pfile->u_buff);
BUFF_FRONT (pfile->u_buff) = dest + 1;
return new_string_token (pfile, dest - len, len);