aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/strftime.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/strftime.c b/lib/strftime.c
index 18c899d2117..99bee4ef978 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -1123,23 +1123,18 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
1123 if (modifier == L_('E')) 1123 if (modifier == L_('E'))
1124 goto bad_format; 1124 goto bad_format;
1125 1125
1126 { 1126 number_value = ns;
1127 /* Use a new variable here instead of reusing number_value 1127 if (width == -1)
1128 because Clang complains about the self-assignment 1128 width = 9;
1129 generated by DO_NUMBER. */ 1129 else
1130 ptrdiff_t n = ns; 1130 {
1131 if (width == -1) 1131 /* Take an explicit width less than 9 as a precision. */
1132 width = 9; 1132 int j;
1133 else 1133 for (j = width; j < 9; j++)
1134 { 1134 number_value /= 10;
1135 /* Take an explicit width less than 9 as a precision. */ 1135 }
1136 int j;
1137 for (j = width; j < 9; j++)
1138 n /= 10;
1139 }
1140 1136
1141 DO_NUMBER (width, n); 1137 DO_NUMBER (width, number_value);
1142 }
1143#endif 1138#endif
1144 1139
1145 case L_('n'): 1140 case L_('n'):