Commit 9b154c23 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Fixed bug reported to Gregor Hoffleit:

> mpz.mpz('\xff') should return mpz(255).  Instead it returns
> mpz(4294967295L). Looks like the constructor doesn't work with strings
> containing characters above chr(128).
Caused by using just 'char' where 'unsigned char' should have been used.
parent c3b15645
......@@ -969,7 +969,7 @@ MPZ_mpz(self, args)
mpz_clear(&mplongdigit);
}
else if (PyString_Check(objp)) {
char *cp = PyString_AS_STRING(objp);
unsigned char *cp = (unsigned char *)PyString_AS_STRING(objp);
int len = PyString_GET_SIZE(objp);
MP_INT mplongdigit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment