From 20b833bc8ef86de12747e4b15e928f0a4d4eab58 Mon Sep 17 00:00:00 2001 From: Ari Lemmetti Date: Fri, 31 Jul 2015 18:44:36 +0300 Subject: [PATCH] Fix mingw errors --- src/cli.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli.c b/src/cli.c index a0043ff5..ccfa2675 100644 --- a/src/cli.c +++ b/src/cli.c @@ -98,13 +98,13 @@ static int select_input_res_auto(const char *file_name, int32_t *out_width, int3 // Find the last delimiter char ( / or \ ). Hope the other kind is not used in the name. // If delim is not found, set pointer to the beginning. - char* sub_str = MAX(strrchr(file_name, '/'), strrchr(file_name, '\\')); - if (!sub_str) sub_str = (char*)file_name; + unsigned char* sub_str = (unsigned char*)MAX(strrchr(file_name, '/'), strrchr(file_name, '\\')); + if (!sub_str) sub_str = (unsigned char*)file_name; int success = 0; // Try if the substring starts with "x" without either of them being 0 do { - success = (sscanf(sub_str, "%dx%d%*s", out_width, out_height) == 2); + success = (sscanf((char*)sub_str, "%dx%d%*s", out_width, out_height) == 2); success &= (*out_width > 0 && *out_height > 0); // Move to the next char until a digit is found or the string ends do{