Skip to content

Commit c00e896

Browse files
committed
utils/util_io.c: use MAX_OSPATH for filename arrays
1 parent 8a0a820 commit c00e896

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

utils/common/util_io.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
static HANDLE findhandle = INVALID_HANDLE_VALUE;
8585
static WIN32_FIND_DATA finddata;
86-
static char findstr[256];
86+
static char findstr[MAX_OSPATH];
8787

8888
const char *Q_FindFirstFile (const char *path, const char *pattern)
8989
{
@@ -203,7 +203,7 @@ int Q_FileType (const char *path)
203203

204204
static HDIR findhandle = HDIR_CREATE;
205205
static FILEFINDBUF3 findbuffer;
206-
static char findstr[256];
206+
static char findstr[MAX_OSPATH];
207207

208208
const char *Q_FindFirstFile (const char *path, const char *pattern)
209209
{
@@ -327,7 +327,7 @@ int Q_FileType (const char *path)
327327

328328
static struct ffblk finddata;
329329
static int findhandle = -1;
330-
static char findstr[256];
330+
static char findstr[MAX_OSPATH];
331331

332332
const char *Q_FindFirstFile (const char *path, const char *pattern)
333333
{
@@ -620,7 +620,7 @@ int Q_FileType (const char *path)
620620
static DIR *finddir;
621621
static struct dirent *finddata;
622622
static char *findpath, *findpattern;
623-
static char matchpath[256];
623+
static char matchpath[MAX_OSPATH];
624624

625625
const char *Q_FindFirstFile (const char *path, const char *pattern)
626626
{
@@ -957,12 +957,10 @@ int Q_WriteFileFromHandle (FILE *fromfile, const char *topath, size_t size)
957957
{
958958
char buf[COPY_READ_BUFSIZE];
959959
FILE *out;
960-
/* off_t remaining, count;*/
961-
size_t remaining, count;
962-
char temp[1024];
960+
size_t remaining, count; /* off_t */
963961

964-
strcpy (temp, topath);
965-
CreatePath (temp);
962+
strcpy (buf, topath);
963+
CreatePath (buf);
966964

967965
out = fopen (topath, "wb");
968966
if (!out)

0 commit comments

Comments
 (0)