Skip to content

Commit

Permalink
Remove BUFFER_SIZE.
Browse files Browse the repository at this point in the history
  • Loading branch information
Galfurian committed Oct 4, 2024
1 parent c9dd516 commit 3086636
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libc/src/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,7 @@ static void cropzeros(char *buffer)
/// @return Pointer to the next position in the output string after the formatted number.
static char *flt(char *str, double num, int size, int precision, char fmt, unsigned flags)
{
const unsigned BUFFER_SIZE = 80;
char workbuf[BUFFER_SIZE];
char workbuf[80];
char c, sign;
int n, i;

Expand Down Expand Up @@ -600,7 +599,7 @@ static char *flt(char *str, double num, int size, int precision, char fmt, unsig
}

/// Calculate the length of the resulting string `workbuf`.
n = strnlen(workbuf, BUFFER_SIZE);
n = strnlen(workbuf, 80);

/// Adjust size to account for the length of the output string.
size -= n;
Expand Down

0 comments on commit 3086636

Please sign in to comment.