addressing few gcc 13 analyser warnings.
This commit is contained in:
parent
f67b65c00a
commit
571f3f6fec
|
@ -575,10 +575,13 @@ void
|
||||||
Sys_RemoveDir(const char *path)
|
Sys_RemoveDir(const char *path)
|
||||||
{
|
{
|
||||||
char filepath[MAX_OSPATH];
|
char filepath[MAX_OSPATH];
|
||||||
DIR *directory = opendir(path);
|
|
||||||
struct dirent *file;
|
struct dirent *file;
|
||||||
|
DIR *directory;
|
||||||
|
|
||||||
if (Sys_IsDir(path))
|
if (Sys_IsDir(path))
|
||||||
|
{
|
||||||
|
directory = opendir(path);
|
||||||
|
if (directory)
|
||||||
{
|
{
|
||||||
while ((file = readdir(directory)) != NULL)
|
while ((file = readdir(directory)) != NULL)
|
||||||
{
|
{
|
||||||
|
@ -590,6 +593,7 @@ Sys_RemoveDir(const char *path)
|
||||||
Sys_Remove(path);
|
Sys_Remove(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
qboolean
|
qboolean
|
||||||
Sys_Realpath(const char *in, char *out, size_t size)
|
Sys_Realpath(const char *in, char *out, size_t size)
|
||||||
|
|
|
@ -5458,9 +5458,8 @@ PlayerDirectoryList(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// malloc directories
|
// malloc directories
|
||||||
char** data = (char**)malloc(num * sizeof(char*));
|
char** data = (char**)calloc(num, sizeof(char*));
|
||||||
YQ2_COM_CHECK_OOM(data, "malloc()", num * sizeof(char*))
|
YQ2_COM_CHECK_OOM(data, "calloc()", num * sizeof(char*))
|
||||||
memset(data, 0, num * sizeof(char*));
|
|
||||||
|
|
||||||
s_directory.data = data;
|
s_directory.data = data;
|
||||||
s_directory.num = num;
|
s_directory.num = num;
|
||||||
|
@ -5509,8 +5508,8 @@ PlayerModelList(void)
|
||||||
qboolean result = true;
|
qboolean result = true;
|
||||||
|
|
||||||
// malloc models
|
// malloc models
|
||||||
data = (char**)malloc(MAX_PLAYERMODELS * sizeof(char*));
|
data = (char**)calloc(MAX_PLAYERMODELS, sizeof(char*));
|
||||||
memset(data, 0, MAX_PLAYERMODELS * sizeof(char*));
|
YQ2_COM_CHECK_OOM(data, "calloc()", MAX_PLAYERMODELS * sizeof(char*))
|
||||||
|
|
||||||
s_modelname.data = data;
|
s_modelname.data = data;
|
||||||
s_modelname.num = 0;
|
s_modelname.num = 0;
|
||||||
|
|
Loading…
Reference in New Issue