Currently, show_indent() use a single static buffer. It thus can't be used like: printf("%s %s", show_ident(a), show_ident(b)); Fix this by using multiple buffers like done for show_pseudo() and others. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- tokenize.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tokenize.c b/tokenize.c index 0d17d42d1..5ee4718d5 100644 --- a/tokenize.c +++ b/tokenize.c @@ -88,9 +88,13 @@ const char *show_special(int val) const char *show_ident(const struct ident *ident) { - static char buffer[256]; + static char buff[2][256]; + static int n; + char *buffer; + if (!ident) return "<noident>"; + buffer = buff[2 & ++n]; sprintf(buffer, "%.*s", ident->len, ident->name); return buffer; } -- 2.19.0