Re: -lmcheck new FAILs for __FILE__ [Re: FYI: fix PR macros/13205]

Tom Tromey
2012-05-21T15:27:26Z

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> FAIL: gdb.base/macscp.exp: info macro __FILE__ before running
Jan> FAIL: gdb.base/macscp.exp: print __FILE__

I reproduced it with valgrind and I'm checking in the appended to fix it.

Tom

2012-05-21 Tom Tromey <tromey@redhat.com>

* macroexp.c (macro_stringify): Terminate the string.

diff --git a/gdb/macroexp.c b/gdb/macroexp.c
index 22b904e..fa34311 100644
--- a/gdb/macroexp.c
+++ b/gdb/macroexp.c
@@ -704,6 +704,7 @@ macro_stringify (const char *str)

init_buffer (&buffer, len);
stringify (&buffer, str, len);
+ appendc (&buffer, '\0');

return free_buffer_return_text (&buffer);
}