From 427d5664ef31ac4ab1035ab2cd27159995a3e70c Mon Sep 17 00:00:00 2001 From: steve Date: Mon, 16 Apr 2007 00:47:12 +0000 Subject: [PATCH] Fix missing zero if time value is exactly 0. --- vpi/sys_display.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vpi/sys_display.c b/vpi/sys_display.c index 308e39ea7..cdd9b6010 100644 --- a/vpi/sys_display.c +++ b/vpi/sys_display.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: sys_display.c,v 1.77 2007/04/15 20:45:40 steve Exp $" +#ident "$Id: sys_display.c,v 1.78 2007/04/16 00:47:12 steve Exp $" #endif # include "vpi_config.h" @@ -279,16 +279,17 @@ static void format_time(unsigned mcd, int fsize, /* Fill the leading characters to make up the desired width. This may require a '0' if the last character - written was the decimal point. */ + written was the decimal point. This may also require a '0' + if there are no other characters at all in the ouput. */ if (fusize > 0) { while (bp > start_address) { - if (*bp == '.') + if (*bp == '.' || strcmp(bp, timeformat_info.suff) == 0) *--bp = '0'; else *--bp = ' '; } } else { - if (*bp == '.') + if (*bp == '.' || strcmp(bp, timeformat_info.suff) == 0) *--bp = '0'; } @@ -1652,6 +1653,9 @@ void sys_display_register() /* * $Log: sys_display.c,v $ + * Revision 1.78 2007/04/16 00:47:12 steve + * Fix missing zero if time value is exactly 0. + * * Revision 1.77 2007/04/15 20:45:40 steve * Attach line number information to task calls. *