mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	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.
			
			
This commit is contained in:
		
							parent
							
								
									cada2938f7
								
							
						
					
					
						commit
						4c07f81d60
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -969,7 +969,7 @@ MPZ_mpz(self, args)
 | 
				
			||||||
		mpz_clear(&mplongdigit);
 | 
							mpz_clear(&mplongdigit);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	else if (PyString_Check(objp)) {
 | 
						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);
 | 
							int len = PyString_GET_SIZE(objp);
 | 
				
			||||||
		MP_INT mplongdigit;
 | 
							MP_INT mplongdigit;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue