projects
/
u
/
mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d2fdbc2
)
Bug fix in binary input.
author
mdw
<mdw>
Sat, 15 Jul 2000 10:01:08 +0000
(10:01 +0000)
committer
mdw
<mdw>
Sat, 15 Jul 2000 10:01:08 +0000
(10:01 +0000)
mptext.c
patch
|
blob
|
blame
|
history
diff --git
a/mptext.c
b/mptext.c
index
891e414
..
952ec88
100644
(file)
--- a/
mptext.c
+++ b/
mptext.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: mptext.c,v 1.
6 2000/06/25 12:58:23
mdw Exp $
+ * $Id: mptext.c,v 1.
7 2000/07/15 10:01:08
mdw Exp $
*
* Textual representation of multiprecision numbers
*
*
* Textual representation of multiprecision numbers
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: mptext.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: mptext.c,v $
+ * Revision 1.7 2000/07/15 10:01:08 mdw
+ * Bug fix in binary input.
+ *
* Revision 1.6 2000/06/25 12:58:23 mdw
* Fix the derivation of `depth' commentary.
*
* Revision 1.6 2000/06/25 12:58:23 mdw
* Fix the derivation of `depth' commentary.
*
@@
-166,7
+169,7
@@
mp *mp_read(mp *m, int radix, const mptext_ops *ops, void *p)
/* --- Handle an initial sign --- */
/* --- Handle an initial sign --- */
- if (ch == '-') {
+ if (
radix >= 0 &&
ch == '-') {
f |= f_neg;
ch = ops->get(p);
while (isspace(ch))
f |= f_neg;
ch = ops->get(p);
while (isspace(ch))
@@
-203,6
+206,9
@@
mp *mp_read(mp *m, int radix, const mptext_ops *ops, void *p)
for (;; ch = ops->get(p)) {
int x;
for (;; ch = ops->get(p)) {
int x;
+ if (ch < 0)
+ break;
+
/* --- An underscore indicates a numbered base --- */
if (ch == '_' && r > 0 && r <= 36) {
/* --- An underscore indicates a numbered base --- */
if (ch == '_' && r > 0 && r <= 36) {