From ee1ec1a1b004c1239ccb8194ca721cbcfcb87f7f Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Fri, 16 Feb 2018 11:23:38 +0100 Subject: [PATCH] Load_Unicode_font(): Warning_with_format(), better filename parsing --- src/init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/init.c b/src/init.c index 0be5b18c..cc27c985 100644 --- a/src/init.c +++ b/src/init.c @@ -783,9 +783,9 @@ static void Load_Unicode_font(const char * fullname, const char * filename) unsigned int first, last; (void)fullname; - if (memcmp(filename, "unicode", 7) != 0) + if (strncasecmp(filename, "unicode_", 8) != 0) return; - if (sscanf(filename, "unicode_%04X-%04X.png", &first, &last) == 2) + if (sscanf(filename + 8, "%04X-%04X.", &first, &last) == 2) { font = Load_font(filename, 0); if (font) @@ -799,7 +799,7 @@ static void Load_Unicode_font(const char * fullname, const char * filename) } } else - Warning("Could not parse filename"); + Warning_with_format("Could not parse filename %s", filename); } void Load_Unicode_fonts(void)