diff --git a/boot/console.c b/boot/console.c index 233ac242..99cba298 100644 --- a/boot/console.c +++ b/boot/console.c @@ -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; @@ -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; @@ -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; @@ -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;