diff --git a/src/core/cpath/cpath.c b/src/core/cpath/cpath.c index 35b3829..6629d1c 100644 --- a/src/core/cpath/cpath.c +++ b/src/core/cpath/cpath.c @@ -1,6 +1,7 @@ #include "cpath.h" #include "aliases.h" #include +#include #include #include @@ -47,7 +48,10 @@ void dirup(char *dst, u64 levels, const char *path) { char tmp[256]; sprintf(tmp, "%c", PATH_SEP); - if (sep_count < levels && strncmp(path, tmp, copy_count) != 0) { + // NOTE (Abdelrahman): Conditions stored in variables to silence MSVC warning C5045 + bool insufficient_levels = sep_count < levels; + bool path_to_copy_is_separator = strncmp(path, tmp, copy_count) != 0; + if (insufficient_levels && path_to_copy_is_separator) { copy_count = 0; }