diff options
| author | Alexander Buhl <[email protected]> | 2020-12-13 16:06:55 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-13 16:06:55 +0100 |
| commit | a798fd401f777a70e3cd568f76bd1dd9e6cf128f (patch) | |
| tree | c3a20c0d553927a42bf111cff58bfb078671ef65 /examples/text | |
| parent | 342d4faf14fd428d7797285b3727f0e440879cf3 (diff) | |
| download | raylib-a798fd401f777a70e3cd568f76bd1dd9e6cf128f.tar.gz raylib-a798fd401f777a70e3cd568f76bd1dd9e6cf128f.zip | |
Fixed #1455 (#1456)
* Fixed #1455
Fixed writing out of array bounds
Adjusted FPS comment to match value
Deleted unused function at the end, which has never been in use in the history of this file
* Fixed #1455
Readded the function
Diffstat (limited to 'examples/text')
| -rw-r--r-- | examples/text/text_input_box.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/text/text_input_box.c b/examples/text/text_input_box.c index 174c38d6..0f35a581 100644 --- a/examples/text/text_input_box.c +++ b/examples/text/text_input_box.c @@ -30,7 +30,7 @@ int main(void) int framesCounter = 0; - SetTargetFPS(10); // Set our game to run at 60 frames-per-second + SetTargetFPS(10); // Set our game to run at 10 frames-per-second //-------------------------------------------------------------------------------------- // Main game loop @@ -65,9 +65,8 @@ int main(void) if (IsKeyPressed(KEY_BACKSPACE)) { letterCount--; - name[letterCount] = '\0'; - if (letterCount < 0) letterCount = 0; + name[letterCount] = '\0'; } } else if (GetMouseCursor() != MOUSE_CURSOR_DEFAULT) SetMouseCursor(MOUSE_CURSOR_DEFAULT); @@ -124,4 +123,4 @@ bool IsAnyKeyPressed() if ((key >= 32) && (key <= 126)) keyPressed = true; return keyPressed; -}
\ No newline at end of file +} |
