diff options
author | Loïc Blot <loic.blot@unix-experience.fr> | 2018-12-04 12:38:11 +0100 |
---|---|---|
committer | Loïc Blot <loic.blot@unix-experience.fr> | 2018-12-04 12:39:19 +0100 |
commit | 7f545db9770e5bf454545ce97900eaba30b77856 (patch) | |
tree | 2d512b8a692580e7ce4a58c7e5d414c47d18179b /src | |
parent | 39ea1cd4283a77066d5f63b90146dfb17de813a8 (diff) | |
download | minetest-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')
-rw-r--r-- | src/filesys.cpp | 2 |
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]; |