Skip to content

Commit c29afcb

Browse files
committed
Fix -Werror=stringop-truncation build failure in fileutils.c
1 parent ea142fe commit c29afcb

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

client/src/fileutils.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3036,9 +3036,7 @@ static int filelist(const char *path, const char *ext, uint8_t last, bool tentat
30363036
for (int i = 0; i < n; i++) {
30373037

30383038
char tmp_fullpath[1024] = {0};
3039-
strncat(tmp_fullpath, path, sizeof(tmp_fullpath) - 1);
3040-
tmp_fullpath[1023] = 0x00;
3041-
strncat(tmp_fullpath, namelist[i]->d_name, strlen(tmp_fullpath) - 1);
3039+
snprintf(tmp_fullpath, sizeof(tmp_fullpath), "%s%s", path, namelist[i]->d_name);
30423040

30433041
if (path_is_directory(tmp_fullpath)) {
30443042

0 commit comments

Comments
 (0)