Fix ntoab.
authorDanny Milosavljevic <dannym@scratchpost.org>
Mon, 1 Jul 2019 18:04:26 +0000 (20:04 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 1 Jul 2019 18:04:26 +0000 (20:04 +0200)
Follow-up to b5b19304b59fefbed923b146ec8c8d495556fa76.

* lib/mes/ntoab.c (ntoab): Fix non-MESC case.

lib/mes/ntoab.c

index 4b305925591d6778c1e56593ad14250e0f3f682a..548e45eb6ec308c38840b072c8bc28343ed9a371 100644 (file)
@@ -45,7 +45,7 @@ ntoab (long x, int base, int signed_p)
 #if __MESC__
       u = __mesabi_uldiv(u, (unsigned long) base, &i);
 #else
-      i = i % base;
+      i = u % base;
       u = u / base;
 #endif
       *p-- = i > 9 ? 'a' + i - 10 : '0' + i;