From a512a77bba0fcf7b9c32020bc7c503ed3f6e9f2b Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 13 May 2009 21:51:05 +0000 Subject: [PATCH] enhanced write_num() in sed --- qse/lib/utl/sed.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qse/lib/utl/sed.c b/qse/lib/utl/sed.c index 9ba43080..2d6c1571 100644 --- a/qse/lib/utl/sed.c +++ b/qse/lib/utl/sed.c @@ -1408,13 +1408,15 @@ static int write_str (qse_sed_t* sed, const qse_char_t* str, qse_size_t len) static int write_num (qse_sed_t* sed, qse_size_t x, int base, int width) { qse_size_t last = x % base; - qse_size_t y = 0, dig = 0; + qse_size_t y = 0; + int dig = 0; QSE_ASSERT (base >= 2 && base <= 10); if (x < 0) { if (write_char (sed, QSE_T('-')) <= -1) return -1; + if (width > 0) width--; } x = x / base;