diff --git a/mhl/string.h b/mhl/string.h index f4c56e5ec..ee74e1d48 100644 --- a/mhl/string.h +++ b/mhl/string.h @@ -149,11 +149,11 @@ static inline char* mhl_str_dir_plus_file(const char* dirname, const char* filen filename++; /* skip trailing slashes on dirname */ - int dnlen = strlen(dirname); - while (dnlen && (dirname[dnlen-1]=='/')) + size_t dnlen = strlen(dirname); + while ((dnlen != 0) && (dirname[dnlen-1]=='/')) dnlen--; - int fnlen = strlen(filename); + size_t fnlen = strlen(filename); char* buffer = mhl_mem_alloc_z(dnlen+fnlen+2); /* enough space for dirname, /, filename, zero */ char* ptr = buffer;