summaryrefslogtreecommitdiff
path: root/lib/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/strftime.c')
-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)
if (modifier == L_('E'))
goto bad_format;
- {
- /* Use a new variable here instead of reusing number_value
- because Clang complains about the self-assignment
- generated by DO_NUMBER. */
- ptrdiff_t n = ns;
- if (width == -1)
- width = 9;
- else
- {
- /* Take an explicit width less than 9 as a precision. */
- int j;
- for (j = width; j < 9; j++)
- n /= 10;
- }
+ number_value = ns;
+ if (width == -1)
+ width = 9;
+ else
+ {
+ /* Take an explicit width less than 9 as a precision. */
+ int j;
+ for (j = width; j < 9; j++)
+ number_value /= 10;
+ }
- DO_NUMBER (width, n);
- }
+ DO_NUMBER (width, number_value);
#endif
case L_('n'):