summaryrefslogtreecommitdiff
path: root/firmware/common
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common')
-rw-r--r--firmware/common/rbpaths.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/common/rbpaths.c b/firmware/common/rbpaths.c
index 8cf92fab4a..69543bc3a7 100644
--- a/firmware/common/rbpaths.c
+++ b/firmware/common/rbpaths.c
@@ -343,7 +343,7 @@ DIR* app_opendir(const char *_name)
343 struct __dir *this = (struct __dir*)buf; 343 struct __dir *this = (struct __dir*)buf;
344 /* carefully remove any trailing slash from the input, so that 344 /* carefully remove any trailing slash from the input, so that
345 * hash/path matching in readdir() works properly */ 345 * hash/path matching in readdir() works properly */
346 while (name[name_len-1] == '/') 346 while (name[name_len-1] == '/' && name_len > 1)
347 name_len -= 1; 347 name_len -= 1;
348 /* strcpy cannot be used because of trailing slashes */ 348 /* strcpy cannot be used because of trailing slashes */
349 memcpy(this->path, name, name_len); 349 memcpy(this->path, name, name_len);