From e66f8481e39b76e00dac17dcc021929ec3f087b0 Mon Sep 17 00:00:00 2001 From: "hyunghwan.chung" Date: Wed, 28 Feb 2018 15:56:10 +0000 Subject: [PATCH] fixed the wrong case issue in moo_inttostr() --- moo/lib/bigint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/moo/lib/bigint.c b/moo/lib/bigint.c index 4cc7850..bf45fad 100644 --- a/moo/lib/bigint.c +++ b/moo/lib/bigint.c @@ -4021,6 +4021,7 @@ moo_oop_t moo_inttostr (moo_t* moo, moo_oop_t num, int radix) moo_oow_t xlen = 0, seglen, reqcapa; const char* _digitc; + int orgradix = radix; if (radix < 0) { @@ -4056,7 +4057,7 @@ moo_oop_t moo_inttostr (moo_t* moo, moo_oop_t num, int radix) xbuf = moo->inttostr.xbuf.ptr; } - xlen = oow_to_text(moo, w, radix, xbuf); + xlen = oow_to_text(moo, w, orgradix, xbuf); if (v < 0) xbuf[xlen++] = '-'; reverse_string (xbuf, xlen); @@ -4207,7 +4208,7 @@ moo_oop_t moo_inttostr (moo_t* moo, moo_oop_t num, int radix) #else # error UNSUPPORTED LIW BIT SIZE #endif - seglen = oow_to_text (moo, w, radix, &xbuf[xlen]); + seglen = oow_to_text (moo, w, orgradix, &xbuf[xlen]); xlen += seglen; if (r == a) break; /* reached the last block */