mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-21 19:32:30 +00:00
Compile fixes, oops..
This commit is contained in:
parent
2678aa601f
commit
a644fd8b84
1 changed files with 6 additions and 4 deletions
|
@ -715,19 +715,21 @@ pack_t *COM_LoadPackZipFile (char *packfile)
|
|||
}
|
||||
#endif
|
||||
|
||||
#define FBLOCK_SIZE 32
|
||||
#define FNAME_SIZE MAX_OSPATH
|
||||
|
||||
void
|
||||
COM_LoadGameDirectory(char *dir)
|
||||
{
|
||||
searchpath_t *search;
|
||||
pack_t *pak;
|
||||
char pakfile[MAX_OSPATH];
|
||||
DIR *dir_ptr;
|
||||
struct dirent *dirent;
|
||||
char **pakfiles;
|
||||
int i = 0, bufsize = 0, count = 0;
|
||||
|
||||
pakfiles = calloc(1, BLOCK_SIZE);
|
||||
bufsize += BLOCK_SIZE;
|
||||
pakfiles = calloc(1, FBLOCK_SIZE);
|
||||
bufsize += FBLOCK_SIZE;
|
||||
if (!pakfiles)
|
||||
goto COM_LoadGameDirectory_free;
|
||||
|
||||
|
@ -738,7 +740,7 @@ COM_LoadGameDirectory(char *dir)
|
|||
while ((dirent = readdir(dir_ptr))) {
|
||||
if (!fnmatch("*.pak", dirent->d_name, FNMATCH_FLAGS)) {
|
||||
if (count >= bufsize) {
|
||||
bufsize += BLOCK_SIZE;
|
||||
bufsize += FBLOCK_SIZE;
|
||||
pakfiles = realloc(pakfiles, bufsize);
|
||||
if (!pakfiles)
|
||||
goto COM_LoadGameDirectory_free;
|
||||
|
|
Loading…
Reference in a new issue