From a3c9a7a159a83e8315ae7b49165b1e8efd22523b Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Wed, 7 Mar 2001 05:46:58 +0000 Subject: [PATCH] leading space fix --- goldlib/gall/gtimutil.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/goldlib/gall/gtimutil.cpp b/goldlib/gall/gtimutil.cpp index 99a21f3..362bc3d 100644 --- a/goldlib/gall/gtimutil.cpp +++ b/goldlib/gall/gtimutil.cpp @@ -166,12 +166,13 @@ static void strfmt(char *str, const char *fmt, ...) { ival = va_arg(vp, int); bool padding = true; while(ilen) { - ival = (ival % pow[ilen]) / pow[ilen-1]; - if(ival) + ival %= pow[ilen]; + int cval = ival / pow[ilen-1]; + if(cval) padding = false; if(--ilen and padding) - ival = ' ' - '0'; - *str++ = (char)('0' + ival); + cval = ' ' - '0'; + *str++ = (char)('0' + cval); } } else {