* Ouch, parseHash32 was completely broken. All digits >= 4 were

parsed as 4.

  For a moment I worried that printHash32 was broken, and that would
  have been really, *really* bad ;-)
This commit is contained in:
Eelco Dolstra 2006-03-01 17:59:08 +00:00
parent 74166f2f44
commit e136532800
1 changed files with 1 additions and 1 deletions

View File

@ -178,7 +178,7 @@ Hash parseHash32(HashType ht, const string & s)
for (unsigned int i = 0; i < s.length(); ++i) {
char c = s[i];
unsigned char digit;
for (digit = 0; digit < sizeof(chars); ++digit) /* !!! slow */
for (digit = 0; digit < base32Chars.size(); ++digit) /* !!! slow */
if (chars[digit] == c) break;
if (digit >= 32)
throw Error(format("invalid base-32 hash `%1%'") % s);