Skip to content

Commit

Permalink
nprintf() didn't fully respect the target width parameter when handli…
Browse files Browse the repository at this point in the history
…ng % arguments
  • Loading branch information
mywave82 committed Oct 21, 2024
1 parent 71580bf commit 850aba7
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions boot/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ static void display_nprintf (uint16_t y, uint16_t x, uint8_t color, uint16_t wid
{
requested_width = requested_precision;
}
if (requested_precision > width)
{
requested_precision = width;
}
if (requested_width > width)
{
requested_width = width;
}
if (requested_precision > requested_width)
{
requested_precision = requested_width;
Expand Down Expand Up @@ -408,6 +416,14 @@ static void display_nprintf (uint16_t y, uint16_t x, uint8_t color, uint16_t wid
{
requested_width = requested_precision;
}
if (requested_precision > width)
{
requested_precision = width;
}
if (requested_width > width)
{
requested_width = width;
}
if (requested_precision > requested_width)
{
requested_precision = requested_width;
Expand Down Expand Up @@ -508,6 +524,14 @@ static void display_nprintf (uint16_t y, uint16_t x, uint8_t color, uint16_t wid
{
requested_width = requested_precision;
}
if (requested_precision > width)
{
requested_precision = width;
}
if (requested_width > width)
{
requested_width = width;
}
if (requested_precision > requested_width)
{
requested_precision = requested_width;
Expand Down Expand Up @@ -582,6 +606,14 @@ static void display_nprintf (uint16_t y, uint16_t x, uint8_t color, uint16_t wid
{
requested_width = requested_precision;
}
if (requested_precision > width)
{
requested_precision = width;
}
if (requested_width > width)
{
requested_width = width;
}
if (requested_precision > requested_width)
{
requested_precision = requested_width;
Expand Down

0 comments on commit 850aba7

Please sign in to comment.