summaryrefslogtreecommitdiff
path: root/src/filesys.cpp
diff options
context:
space:
mode:
authorLoïc Blot <loic.blot@unix-experience.fr>2018-12-04 12:38:11 +0100
committerLoïc Blot <loic.blot@unix-experience.fr>2018-12-04 12:39:19 +0100
commit7f545db9770e5bf454545ce97900eaba30b77856 (patch)
tree2d512b8a692580e7ce4a58c7e5d414c47d18179b /src/filesys.cpp
parent39ea1cd4283a77066d5f63b90146dfb17de813a8 (diff)
downloadminetest-7f545db9770e5bf454545ce97900eaba30b77856.tar.gz
minetest-7f545db9770e5bf454545ce97900eaba30b77856.tar.bz2
minetest-7f545db9770e5bf454545ce97900eaba30b77856.zip
Fix a stringop-truncation GCC warning
``` minetest/src/filesys.cpp:312:10: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 10000 equals destination size [-Wstringop-truncation] strncpy(argv_data[2], path.c_str(), 10000); ```
Diffstat (limited to 'src/filesys.cpp')
-rw-r--r--src/filesys.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/filesys.cpp b/src/filesys.cpp
index dc34b6b56..f61b39b94 100644
--- a/src/filesys.cpp
+++ b/src/filesys.cpp
@@ -309,7 +309,7 @@ bool RecursiveDelete(const std::string &path)
strcpy(argv_data[0], "/bin/rm");
#endif
strcpy(argv_data[1], "-rf");
- strncpy(argv_data[2], path.c_str(), 10000);
+ strncpy(argv_data[2], path.c_str(), sizeof(argv_data[2]) - 1);
char *argv[4];
argv[0] = argv_data[0];
argv[1] = argv_data[1];