From 37a3fc4df3c1b89a19f6961e0a87822e775234f2 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Fri, 28 Apr 2023 18:25:35 +0200 Subject: [PATCH] Codechange: replace strstr with more appropriate function --- src/openttd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openttd.cpp b/src/openttd.cpp index 19a2bc515b..f8c29ee392 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -383,9 +383,9 @@ void MakeNewgameSettingsLive() void OpenBrowser(const char *url) { /* Make sure we only accept urls that are sure to open a browser. */ - if (strstr(url, "http://") != url && strstr(url, "https://") != url) return; - - OSOpenBrowser(url); + if (StrStartsWith(url, "http://") || StrStartsWith(url, "https://")) { + OSOpenBrowser(url); + } } /** Callback structure of statements to be executed after the NewGRF scan. */