-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[date] Fix uninitialized values (#23710)
* [date] Fix uninitialized values * update version * add notes for patch * update version
- Loading branch information
1 parent
bfda043
commit 1143d75
Showing
5 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
diff --git a/include/date/date.h b/include/date/date.h | ||
index 9c6f335..3967d6b 100644 | ||
--- a/include/date/date.h | ||
+++ b/include/date/date.h | ||
@@ -6767,7 +6767,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, | ||
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width; | ||
int tH; | ||
int tM; | ||
- long double S; | ||
+ long double S{}; | ||
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2}, | ||
CharT{':'}, rld{S, 1, w}); | ||
checked_set(H, tH, not_a_hour, is); | ||
@@ -7202,7 +7202,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, | ||
// "%I:%M:%S %p" | ||
using dfs = detail::decimal_format_seconds<Duration>; | ||
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width; | ||
- long double S; | ||
+ long double S{}; | ||
int tI = not_a_hour_12_value; | ||
int tM = not_a_minute; | ||
read(is, ru{tI, 1, 2}, CharT{':'}, ru{tM, 1, 2}, | ||
@@ -7258,7 +7258,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, | ||
{ | ||
using dfs = detail::decimal_format_seconds<Duration>; | ||
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width; | ||
- long double S; | ||
+ long double S{}; | ||
read(is, rld{S, 1, width == -1 ? w : static_cast<unsigned>(width)}); | ||
checked_set(s, round_i<Duration>(duration<long double>{S}), | ||
not_a_second, is); | ||
@@ -7292,7 +7292,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, | ||
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width; | ||
int tH = not_a_hour; | ||
int tM = not_a_minute; | ||
- long double S; | ||
+ long double S{}; | ||
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2}, | ||
CharT{':'}, rld{S, 1, w}); | ||
checked_set(H, tH, not_a_hour, is); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters