From 8e7f0e2ea9060498a2bf09615611eaa2346844b5 Mon Sep 17 00:00:00 2001 From: MysterD Date: Wed, 6 Apr 2022 01:39:02 -0700 Subject: [PATCH] Fix warning --- src/pc/network/packets/packet_mod_list.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pc/network/packets/packet_mod_list.c b/src/pc/network/packets/packet_mod_list.c index cd62bccd..93bfe2d8 100644 --- a/src/pc/network/packets/packet_mod_list.c +++ b/src/pc/network/packets/packet_mod_list.c @@ -172,8 +172,9 @@ void network_receive_mod_list(struct Packet* p) { packet_read(p, &file->size, sizeof(u64)); if (mod->isDirectory && !strstr(file->relativePath, "actors")) { char tmp[SYS_MAX_PATH]; - snprintf(tmp, SYS_MAX_PATH, "%s-%s", mod->relativePath, file->relativePath); - memcpy(file->relativePath, tmp, strlen(tmp) + 1); + if (snprintf(tmp, SYS_MAX_PATH, "%s-%s", mod->relativePath, file->relativePath) >= 0) { + memcpy(file->relativePath, tmp, strlen(tmp) + 1); + } } normalize_path(file->relativePath); LOG_INFO(" '%s': %llu", file->relativePath, (u64)file->size);