From 0663b7aeb3b569f83c48b83770e3f45a945f9111 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 9 Aug 2016 23:23:55 -0400 Subject: [PATCH] Allow only one decimal point to be read under "%Ez". --- tz.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tz.h b/tz.h index 403a59e..b55d71b 100644 --- a/tz.h +++ b/tz.h @@ -1600,17 +1600,18 @@ parse(std::basic_istream& is, } if (ratio_less>::value) { - CharT decimal_point = - use_facet>(is.getloc()).decimal_point(); + auto decimal_point = Traits::to_int_type( + use_facet>(is.getloc()).decimal_point()); string buf; while (true) { auto k = is.peek(); if (Traits::eq_int_type(k, Traits::eof())) break; - if (k == decimal_point) + if (Traits::eq_int_type(k, decimal_point)) { buf += '.'; + decimal_point = Traits::eof(); is.get(); } else