mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-22 03:41:27 +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
|
#endif
|
||||||
|
|
||||||
|
#define FBLOCK_SIZE 32
|
||||||
|
#define FNAME_SIZE MAX_OSPATH
|
||||||
|
|
||||||
void
|
void
|
||||||
COM_LoadGameDirectory(char *dir)
|
COM_LoadGameDirectory(char *dir)
|
||||||
{
|
{
|
||||||
searchpath_t *search;
|
searchpath_t *search;
|
||||||
pack_t *pak;
|
pack_t *pak;
|
||||||
char pakfile[MAX_OSPATH];
|
|
||||||
DIR *dir_ptr;
|
DIR *dir_ptr;
|
||||||
struct dirent *dirent;
|
struct dirent *dirent;
|
||||||
char **pakfiles;
|
char **pakfiles;
|
||||||
int i = 0, bufsize = 0, count = 0;
|
int i = 0, bufsize = 0, count = 0;
|
||||||
|
|
||||||
pakfiles = calloc(1, BLOCK_SIZE);
|
pakfiles = calloc(1, FBLOCK_SIZE);
|
||||||
bufsize += BLOCK_SIZE;
|
bufsize += FBLOCK_SIZE;
|
||||||
if (!pakfiles)
|
if (!pakfiles)
|
||||||
goto COM_LoadGameDirectory_free;
|
goto COM_LoadGameDirectory_free;
|
||||||
|
|
||||||
|
@ -738,7 +740,7 @@ COM_LoadGameDirectory(char *dir)
|
||||||
while ((dirent = readdir(dir_ptr))) {
|
while ((dirent = readdir(dir_ptr))) {
|
||||||
if (!fnmatch("*.pak", dirent->d_name, FNMATCH_FLAGS)) {
|
if (!fnmatch("*.pak", dirent->d_name, FNMATCH_FLAGS)) {
|
||||||
if (count >= bufsize) {
|
if (count >= bufsize) {
|
||||||
bufsize += BLOCK_SIZE;
|
bufsize += FBLOCK_SIZE;
|
||||||
pakfiles = realloc(pakfiles, bufsize);
|
pakfiles = realloc(pakfiles, bufsize);
|
||||||
if (!pakfiles)
|
if (!pakfiles)
|
||||||
goto COM_LoadGameDirectory_free;
|
goto COM_LoadGameDirectory_free;
|
||||||
|
|
Loading…
Reference in a new issue