summaryrefslogtreecommitdiff
path: root/src/story_gui.cpp
diff options
context:
space:
mode:
authorRubidium <rubidium@openttd.org>2021-05-10 23:43:52 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-15 10:16:10 +0200
commitbb9121dbd4690405b54e7e6ed6e711ead16435ac (patch)
treeefb930ab320c6be74d4ca8e4d5d674e3d1e7812d /src/story_gui.cpp
parent031e91de6e06e6b0d12603d78170f92f5def1d00 (diff)
downloadopenttd-bb9121dbd4690405b54e7e6ed6e711ead16435ac.tar.xz
Fix: comparison of narrow type to wide type in loop (potential for infinite loops)
Diffstat (limited to 'src/story_gui.cpp')
-rw-r--r--src/story_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/story_gui.cpp b/src/story_gui.cpp
index 0ed39ba04..ccb9ccf7b 100644
--- a/src/story_gui.cpp
+++ b/src/story_gui.cpp
@@ -776,7 +776,7 @@ public:
case WID_SB_SEL_PAGE: {
/* Get max title width. */
- for (uint16 i = 0; i < this->story_pages.size(); i++) {
+ for (size_t i = 0; i < this->story_pages.size(); i++) {
const StoryPage *s = this->story_pages[i];
if (s->title != nullptr) {
@@ -822,7 +822,7 @@ public:
if (!list.empty()) {
/* Get the index of selected page. */
int selected = 0;
- for (uint16 i = 0; i < this->story_pages.size(); i++) {
+ for (size_t i = 0; i < this->story_pages.size(); i++) {
const StoryPage *p = this->story_pages[i];
if (p->index == this->selected_page_id) break;
selected++;