summaryrefslogtreecommitdiff
path: root/lib/printf-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/printf-parse.c')
-rw-r--r--lib/printf-parse.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/printf-parse.c b/lib/printf-parse.c
index 7628cb23..34d241a6 100644
--- a/lib/printf-parse.c
+++ b/lib/printf-parse.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999-2000, 2002-2003, 2006-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002-2003, 2006-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -323,8 +323,6 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
}
{
- arg_type type;
-
/* Parse argument type/size specifiers. */
/* Relevant for the conversion characters d, i. */
arg_type signed_type = TYPE_INT;
@@ -561,6 +559,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
(void) pointer_type;
/* Read the conversion character. */
+ arg_type type;
c = *cp++;
switch (c)
{
@@ -654,17 +653,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
d->count++;
if (d->count >= d_allocated)
{
- size_t memory_size;
- DIRECTIVE *memory;
-
d_allocated = xtimes (d_allocated, 2);
- memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
+ size_t memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
if (size_overflow_p (memory_size))
/* Overflow, would lead to out of memory. */
goto out_of_memory;
- memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir
- ? realloc (d->dir, memory_size)
- : malloc (memory_size));
+ DIRECTIVE *memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir
+ ? realloc (d->dir, memory_size)
+ : malloc (memory_size));
if (memory == NULL)
/* Out of memory. */
goto out_of_memory;