mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-27 00:14:07 +08:00
Count sign as part of the character count.
This commit is contained in:
parent
0ef86f1ced
commit
ab37c362e3
@ -6351,7 +6351,10 @@ read_signed(std::basic_istream<CharT, Traits>& is, unsigned m = 1, unsigned M =
|
|||||||
if (('0' <= c && c <= '9') || c == '-' || c == '+')
|
if (('0' <= c && c <= '9') || c == '-' || c == '+')
|
||||||
{
|
{
|
||||||
if (c == '-' || c == '+')
|
if (c == '-' || c == '+')
|
||||||
|
{
|
||||||
(void)is.get();
|
(void)is.get();
|
||||||
|
--M;
|
||||||
|
}
|
||||||
auto x = static_cast<int>(read_unsigned(is, std::max(m, 1u), M));
|
auto x = static_cast<int>(read_unsigned(is, std::max(m, 1u), M));
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user