Skip to content

Commit

Permalink
Added bounds checking to unsigned int
Browse files Browse the repository at this point in the history
  • Loading branch information
ezh247467 committed Feb 11, 2025
1 parent 94bb762 commit 365a1ec
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/cli/conio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,13 @@ extern "C"
switch (userInput)
{
case '\b':
i--;
SF_OSAL_putch('\b');
SF_OSAL_putch(' ');
SF_OSAL_putch('\b');
if (i > 0)
{
i--;
SF_OSAL_putch('\b');
SF_OSAL_putch(' ');
SF_OSAL_putch('\b');
}
break;
default:
buffer[i++] = userInput;
Expand Down

0 comments on commit 365a1ec

Please sign in to comment.