Browse Source

[trac838] Make sure the parameter passed to isspace() is larger than 0 to avoid ASSERT failing on Windows platform.

Ocean Wang 14 years ago
parent
commit
0e1eaada6f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/lib/util/encode/base_n.cc

+ 2 - 2
src/lib/util/encode/base_n.cc

@@ -166,7 +166,7 @@ public:
     {}
     DecodeNormalizer& operator++() {
         ++base_;
-        while (base_ != base_end_ && isspace(*base_)) {
+        while (base_ != base_end_ && (*base_ > 0) && isspace(*base_)) {
             ++base_;
         }
         if (base_ == base_beginpad_) {
@@ -271,7 +271,7 @@ BaseNTransformer<BitsPerChunk, BaseZeroCode, Encoder, Decoder>::decode(
                 isc_throw(BadValue, "Too many " << algorithm
                           << " padding characters: " << input);
             }
-        } else if (!isspace(ch)) {
+        } else if (ch < 0 || !isspace(ch)) {
             break;
         }
         ++srit;