diff --git a/src/filesystem/SDL_filesystem.c b/src/filesystem/SDL_filesystem.c index 43d31e004d..6a3bb25afc 100644 --- a/src/filesystem/SDL_filesystem.c +++ b/src/filesystem/SDL_filesystem.c @@ -380,7 +380,7 @@ char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_Glob return NULL; } char *ptr = &pathcpy[pathlen-1]; - while ((ptr >= pathcpy) && ((*ptr == '/') || (*ptr == '\\'))) { + while ((ptr > pathcpy) && ((*ptr == '/') || (*ptr == '\\'))) { *(ptr--) = '\0'; } path = pathcpy;