mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 12:41:21 +00:00
requested fixes my last commit: proper null checks + undid my removal of a slash + fixed my previous use of va()
This commit is contained in:
parent
be8bab6603
commit
867046bb8b
3 changed files with 6 additions and 5 deletions
|
@ -496,6 +496,7 @@ Sys_Rename(const char *from, const char *to)
|
|||
void
|
||||
Sys_RemoveDir(const char *path)
|
||||
{
|
||||
char filepath[MAX_OSPATH];
|
||||
DIR *directory = opendir(path);
|
||||
struct dirent *file;
|
||||
|
||||
|
@ -503,11 +504,11 @@ Sys_RemoveDir(const char *path)
|
|||
{
|
||||
while ((file = readdir(directory)) != NULL)
|
||||
{
|
||||
Sys_Remove(va("%s%s", path, file->d_name));
|
||||
sprintf(filepath, "%s/%s", path, file->d_name);
|
||||
Sys_Remove(filepath);
|
||||
}
|
||||
|
||||
closedir(directory);
|
||||
|
||||
Sys_Remove(path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2408,7 +2408,7 @@ LoadGame_MenuKey(int key)
|
|||
|
||||
case K_DEL:
|
||||
|
||||
if ((item = Menu_ItemAtCursor(m)) != 0)
|
||||
if ((item = Menu_ItemAtCursor(m)) != NULL)
|
||||
{
|
||||
if (item->type == MTYPE_ACTION)
|
||||
{
|
||||
|
@ -2539,7 +2539,7 @@ SaveGame_MenuKey(int key)
|
|||
|
||||
case K_DEL:
|
||||
|
||||
if ((item = Menu_ItemAtCursor(m)) != 0)
|
||||
if ((item = Menu_ItemAtCursor(m)) != NULL)
|
||||
{
|
||||
if (item->type == MTYPE_ACTION)
|
||||
{
|
||||
|
|
|
@ -1504,7 +1504,7 @@ void FS_BuildGenericSearchPath(void) {
|
|||
fsRawPath_t *search = fs_rawPath;
|
||||
|
||||
while (search != NULL) {
|
||||
Com_sprintf(path, sizeof(path), "%s%s", search->path, BASEDIRNAME);
|
||||
Com_sprintf(path, sizeof(path), "%s/%s", search->path, BASEDIRNAME);
|
||||
FS_AddDirToSearchPath(path, search->create);
|
||||
|
||||
search = search->next;
|
||||
|
|
Loading…
Reference in a new issue