From 6a832d4240f2ae77a55edd71502b1540818e4fde Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 19 Apr 2000 05:37:03 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/cpplib.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a162f10b1fc..658215ac154 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-04-18 Zack Weinberg + + * cpplib.c (do_pragma_poison): Strings in the token buffer are + not nul-terminated. + Tue Apr 18 16:04:12 2000 Jim Wilson * config/ia64/sysv4.h (SELECT_SECTION): Use data_section if diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 87f245c1673..b42f6b6eb3f 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;