Bug reported by Niakam Kazemi.
blk[digitNum] = theSymbol - 'a' + 10;
else
throw "BigUnsignedInABase(std::string, Base): Bad symbol in input. Only 0-9, A-Z, a-z are accepted.";
+
+ if (blk[digitNum] >= base)
+ throw "BigUnsignedInABase::BigUnsignedInABase(const Digit *, Index, Base): A digit is too large for the specified base";
}
zapLeadingZeros();
}
format, where `.N' goes `.2', `.3', etc. if there are multiple versions on the
same day. The topmost version listed is the one you have.
+Unreleased
+----------
+- BigUnsignedInABase(std::string) Reject digits too big for the base.
+ Bug reported by Niakam Kazemi.
+
2008.07.20
----------
Dennis Yew pointed out serious problems with ambiguities and unwanted
TEST(check(num)); //25
}
+{
+ /* Test that BigUnsignedInABase(std::string) constructor rejects digits
+ * too big for the specified base.
+ * Bug reported by Niakam Kazemi. */
+ TEST(BigUnsignedInABase("f", 10)); //error
+}
+
} catch (const char *err) {
cout << "UNCAUGHT ERROR: " << err << endl;
}