From e136532800113902432c451f0a38bf6d77e5801a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 1 Mar 2006 17:59:08 +0000 Subject: [PATCH] * 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 ;-) --- src/libutil/hash.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index 04e9d22487..1604f1363e 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -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);