diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/common/pathfuncs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/common/pathfuncs.c b/firmware/common/pathfuncs.c index 6b70078eb1..ff3de7b616 100644 --- a/firmware/common/pathfuncs.c +++ b/firmware/common/pathfuncs.c | |||
@@ -476,6 +476,7 @@ size_t path_append_ex(char *buf, const char *basepath, size_t basepath_max, | |||
476 | /* 'component' is absolute; replace all */ | 476 | /* 'component' is absolute; replace all */ |
477 | basepath = component; | 477 | basepath = component; |
478 | component = ""; | 478 | component = ""; |
479 | basepath_max = -1u; | ||
479 | } | 480 | } |
480 | 481 | ||
481 | /* if basepath is not null or empty, buffer contents are replaced, | 482 | /* if basepath is not null or empty, buffer contents are replaced, |
@@ -486,7 +487,7 @@ size_t path_append_ex(char *buf, const char *basepath, size_t basepath_max, | |||
486 | else | 487 | else |
487 | { | 488 | { |
488 | len = strlcpy(buf, basepath, bufsize); | 489 | len = strlcpy(buf, basepath, bufsize); |
489 | if (basepath_max < len && basepath != component) | 490 | if (basepath_max < len) |
490 | { | 491 | { |
491 | len = basepath_max; | 492 | len = basepath_max; |
492 | buf[basepath_max] = '\0'; | 493 | buf[basepath_max] = '\0'; |