about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-03-01T17·59+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-03-01T17·59+0000
commite136532800113902432c451f0a38bf6d77e5801a (patch)
tree33e1d17ae2c9eebc57dfed26d6f22b8e8245e4be /src/libutil
parent74166f2f44a9d2de6dc7862a99e9c2f2bcc9b54b (diff)
* 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 ;-)

Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/hash.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index 04e9d22487a2..1604f1363ea3 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);