mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-03 20:54:27 +02:00
Parse should fail if fmt string is not consumed.
This commit is contained in:
2
date.h
2
date.h
@@ -6177,6 +6177,8 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
|||||||
else
|
else
|
||||||
read(is, CharT{'%'}, width, modified);
|
read(is, CharT{'%'}, width, modified);
|
||||||
}
|
}
|
||||||
|
if (is.rdstate() != ios::goodbit && *fmt != CharT{} && !is.fail())
|
||||||
|
is.setstate(ios::failbit);
|
||||||
if (!is.fail())
|
if (!is.fail())
|
||||||
{
|
{
|
||||||
if (y != not_a_2digit_year)
|
if (y != not_a_2digit_year)
|
||||||
|
Reference in New Issue
Block a user