aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-04-19 05:37:03 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-04-19 05:37:03 +0000
commit6a832d4240f2ae77a55edd71502b1540818e4fde (patch)
tree4621378db8571ebdc693696b3eb8beb27a79420b /gcc/cpplib.c
parent56293c2be23c974508d5e8e680467555c57d7320 (diff)
downloadgcc-6a832d4240f2ae77a55edd71502b1540818e4fde.zip
gcc-6a832d4240f2ae77a55edd71502b1540818e4fde.tar.gz
gcc-6a832d4240f2ae77a55edd71502b1540818e4fde.tar.bz2
cpplib.c (do_pragma_poison): Strings in the token buffer are not nul-terminated.
* cpplib.c (do_pragma_poison): Strings in the token buffer are not nul-terminated. From-SVN: r33247
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 87f245c..b42f6b6 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -1028,14 +1028,14 @@ do_pragma_poison (pfile)
}
p = pfile->token_buffer + written;
- len = strlen (p);
+ len = CPP_PWRITTEN (pfile) - p;
slot = _cpp_lookup_slot (pfile, p, len, INSERT, &hash);
if (*slot)
{
HASHNODE *hp = *slot;
if (hp->type != T_POISON)
{
- cpp_warning (pfile, "poisoning existing macro `%s'", p);
+ cpp_warning (pfile, "poisoning existing macro `%s'", hp->name);
if (hp->type == T_MACRO)
_cpp_free_definition (hp->value.defn);
hp->value.defn = 0;