Allow base 255 (or whatever) in mptext.
authormdw <mdw>
Wed, 1 Dec 2004 01:30:42 +0000 (01:30 +0000)
committermdw <mdw>
Wed, 1 Dec 2004 01:30:42 +0000 (01:30 +0000)
mptext.c

index d528386..9cca8a8 100644 (file)
--- a/mptext.c
+++ b/mptext.c
@@ -155,7 +155,7 @@ mp *mp_read(mp *m, int radix, const mptext_ops *ops, void *p)
     r = -1;
   } else if (radix < 0) {
     rd = -radix;
-    assert(((void)"binary radix must fit in a byte", rd < UCHAR_MAX));
+    assert(((void)"binary radix must fit in a byte", rd <= UCHAR_MAX));
     r = -1;
   } else if (ch != '0') {
     rd = 10;
@@ -669,7 +669,7 @@ int mp_write(mp *m, int radix, const mptext_ops *ops, void *p)
   if (radix > 0)
     assert(((void)"ascii radix must be <= 62", radix <= 62));
   else if (radix < 0)
-    assert(((void)"binary radix must fit in a byte", -radix < UCHAR_MAX));
+    assert(((void)"binary radix must fit in a byte", -radix <= UCHAR_MAX));
   else
     assert(((void)"radix can't be zero in mp_write", 0));