From 8fc35fa32afca70894dfc650fa84ef04970087fd Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sat, 6 Sep 2008 13:23:55 +0100 Subject: [PATCH] Avoid emitting empty string at end of $display translation This happened if the last part of a format string was a % code. --- tgt-vhdl/display.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tgt-vhdl/display.cc b/tgt-vhdl/display.cc index b230002cc..05bbe944a 100644 --- a/tgt-vhdl/display.cc +++ b/tgt-vhdl/display.cc @@ -169,8 +169,10 @@ int draw_stask_display(vhdl_procedural *proc, stmt_container *container, else ss << *p; } - - display_write(container, new vhdl_const_string(ss.str().c_str())); + + // Call Write on any non-empty string data left in the buffer + if (!ss.str().empty()) + display_write(container, new vhdl_const_string(ss.str().c_str())); } else { vhdl_expr *base = translate_expr(net);