mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
addressing few gcc 13 analyser warnings.
This commit is contained in:
parent
f67b65c00a
commit
571f3f6fec
2 changed files with 15 additions and 12 deletions
|
@ -575,19 +575,23 @@ void
|
|||
Sys_RemoveDir(const char *path)
|
||||
{
|
||||
char filepath[MAX_OSPATH];
|
||||
DIR *directory = opendir(path);
|
||||
struct dirent *file;
|
||||
DIR *directory;
|
||||
|
||||
if (Sys_IsDir(path))
|
||||
{
|
||||
while ((file = readdir(directory)) != NULL)
|
||||
directory = opendir(path);
|
||||
if (directory)
|
||||
{
|
||||
snprintf(filepath, MAX_OSPATH, "%s/%s", path, file->d_name);
|
||||
Sys_Remove(filepath);
|
||||
}
|
||||
while ((file = readdir(directory)) != NULL)
|
||||
{
|
||||
snprintf(filepath, MAX_OSPATH, "%s/%s", path, file->d_name);
|
||||
Sys_Remove(filepath);
|
||||
}
|
||||
|
||||
closedir(directory);
|
||||
Sys_Remove(path);
|
||||
closedir(directory);
|
||||
Sys_Remove(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5458,9 +5458,8 @@ PlayerDirectoryList(void)
|
|||
}
|
||||
|
||||
// malloc directories
|
||||
char** data = (char**)malloc(num * sizeof(char*));
|
||||
YQ2_COM_CHECK_OOM(data, "malloc()", num * sizeof(char*))
|
||||
memset(data, 0, num * sizeof(char*));
|
||||
char** data = (char**)calloc(num, sizeof(char*));
|
||||
YQ2_COM_CHECK_OOM(data, "calloc()", num * sizeof(char*))
|
||||
|
||||
s_directory.data = data;
|
||||
s_directory.num = num;
|
||||
|
@ -5509,8 +5508,8 @@ PlayerModelList(void)
|
|||
qboolean result = true;
|
||||
|
||||
// malloc models
|
||||
data = (char**)malloc(MAX_PLAYERMODELS * sizeof(char*));
|
||||
memset(data, 0, MAX_PLAYERMODELS * sizeof(char*));
|
||||
data = (char**)calloc(MAX_PLAYERMODELS, sizeof(char*));
|
||||
YQ2_COM_CHECK_OOM(data, "calloc()", MAX_PLAYERMODELS * sizeof(char*))
|
||||
|
||||
s_modelname.data = data;
|
||||
s_modelname.num = 0;
|
||||
|
|
Loading…
Reference in a new issue