diff --git a/apps/tree.c b/apps/tree.c index 6e52942b45..f31811b9a5 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -669,7 +669,7 @@ static void storefile(char* filename, char* setting, int maxlen) ptr--; } - if (strcmp(ROCKBOX_DIR, currdir) || (len > maxlen-extlen)) + if (strcmp(ROCKBOX_DIR, currdir) || (len-extlen > maxlen)) return; strncpy(setting, filename, len-extlen);