diff options
Diffstat (limited to 'firmware/common/file.c')
-rw-r--r-- | firmware/common/file.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c index 2012e2ff80..202410db81 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c | |||
@@ -1056,7 +1056,7 @@ int rename(const char *old, const char *new) | |||
1056 | FILE_ERROR(EINVAL, -4); | 1056 | FILE_ERROR(EINVAL, -4); |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | //const char * const oldname = strmemdupa(oldinfo.name, oldinfo.length); | 1059 | const char * const oldname = strmemdupa(oldinfo.name, oldinfo.length); |
1060 | const char * const newname = strmemdupa(newinfo.name, newinfo.length); | 1060 | const char * const newname = strmemdupa(newinfo.name, newinfo.length); |
1061 | bool is_overwrite = false; | 1061 | bool is_overwrite = false; |
1062 | 1062 | ||
@@ -1076,8 +1076,7 @@ int rename(const char *old, const char *new) | |||
1076 | FILE_ERROR(ERRNO, rc * 10 - 5); | 1076 | FILE_ERROR(ERRNO, rc * 10 - 5); |
1077 | } | 1077 | } |
1078 | } | 1078 | } |
1079 | else if (!strncmp(newname, oldinfo.name, oldinfo.length) && /* case-only is ok */ | 1079 | else if (!strcmp(newname, oldname)) /* case-only is ok */ |
1080 | newname[oldinfo.length] == '\0') /* make sure of actual match */ | ||
1081 | { | 1080 | { |
1082 | DEBUGF("No name change (success)\n"); | 1081 | DEBUGF("No name change (success)\n"); |
1083 | rc = 0; | 1082 | rc = 0; |