From 605b8a427c902ab366c9e378f0e046514f053231 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 27 Sep 2020 13:21:47 -0700 Subject: [PATCH] Make 'custom_' check more readable Instead of copying to a temporary string, just use SDL_strncmp(). Also, I checked the blame, and apparently I committed the line that used strcmp() instead of SDL_strcmp(), for whatever reason. But that's fixed now. --- desktop_version/src/Scripts.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/desktop_version/src/Scripts.cpp b/desktop_version/src/Scripts.cpp index afc25260..df7a4ac5 100644 --- a/desktop_version/src/Scripts.cpp +++ b/desktop_version/src/Scripts.cpp @@ -11,10 +11,7 @@ void scriptclass::load(const std::string& name) const char* t = name.c_str(); - char customstring[8] = {'\0'}; - SDL_strlcpy(customstring, t, sizeof(customstring)); - - if (strcmp(customstring, "custom_") == 0) + if (SDL_strncmp(t, "custom_", 7) == 0) { loadcustom(name); }