vcscanf: move buffer variables to top of function

This buffer is currently used only when decoding strings.
Place it at the top level so other code can also use it.
Ensure it is initialized to NULL.
This commit is contained in:
Matheus Afonso Martins Moreira 2023-11-02 05:58:47 -03:00
parent 6ca5ab4680
commit 64c883a320

View file

@ -60,6 +60,8 @@ int __vcscanf(int callback(void *), //
struct FreeMe *next;
void *ptr;
} *freeme = NULL;
void *buf = NULL;
size_t bufsize;
const unsigned char *p = (const unsigned char *)fmt;
int *n_ptr;
int items = 0;
@ -84,8 +86,6 @@ int __vcscanf(int callback(void *), //
break;
case '%': {
uint128_t number;
void *buf;
size_t bufsize;
unsigned width = 0;
unsigned char bits = 32;
unsigned char charbytes = sizeof(char);