瀏覽代碼

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
pull/1459/head
Alexander Buhl 4 年之前
committed by GitHub
父節點
當前提交
a798fd401f
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. +3
    -4
      examples/text/text_input_box.c

+ 3
- 4
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;
}
}

Loading…
取消
儲存