Parcourir la source

addressed review comments: use the size of table for range check instead of a fixed magic number; style consistency in assertion.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac256@2537 e5f2f494-b856-4b98-b285-d166d9295462
JINMEI Tatuya il y a 14 ans
Parent
commit
6fba31576d
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/lib/dns/util/binary_from_base32hex.h

+ 2 - 2
src/lib/dns/util/binary_from_base32hex.h

@@ -53,10 +53,10 @@ struct to_5_bit {
         };
         // metrowerks trips this assertion - how come?
         #if ! defined(__MWERKS__)
-        BOOST_STATIC_ASSERT(128 == sizeof(lookup_table));
+        BOOST_STATIC_ASSERT(0x80 == sizeof(lookup_table));
         #endif
         signed char value = -1;
-        if((unsigned)t <= 127)
+        if((unsigned)t < sizeof(lookup_table))
             value = lookup_table[(unsigned)t];
         if(-1 == value) { 
             isc_throw(isc::BadValue,