forked from Mirrorlandia_minetest/minetest
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); ```
This commit is contained in:
parent
39ea1cd428
commit
7f545db977
@ -309,7 +309,7 @@ bool RecursiveDelete(const std::string &path)
|
|||||||
strcpy(argv_data[0], "/bin/rm");
|
strcpy(argv_data[0], "/bin/rm");
|
||||||
#endif
|
#endif
|
||||||
strcpy(argv_data[1], "-rf");
|
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];
|
char *argv[4];
|
||||||
argv[0] = argv_data[0];
|
argv[0] = argv_data[0];
|
||||||
argv[1] = argv_data[1];
|
argv[1] = argv_data[1];
|
||||||
|
Loading…
Reference in New Issue
Block a user