From f33e179936d43aa55447f8b33b161638dd6b48a1 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 25 May 2018 02:38:43 -0700 Subject: [PATCH] Eliminate use of uninitialized offset. --- include/date/date.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/date/date.h b/include/date/date.h index 4eb1c3d..836e326 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -7313,8 +7313,8 @@ from_stream(std::basic_istream& is, const CharT* fmt, fds.wd = weekday{static_cast(wd)}; if (abbrev != nullptr) *abbrev = std::move(temp_abbrev); - if (offset != nullptr) - *offset = temp_offset; + if (offset != nullptr && temp_offset != not_a_offset) + *offset = temp_offset; } return is; }