mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Fix a sizeof braino.
Somebody (probably me) got a little over-happy with sizeof.
This commit is contained in:
parent
f63e505c92
commit
824e33c82b
1 changed files with 3 additions and 2 deletions
|
@ -216,12 +216,13 @@ Qdopen (int fd, const char *mode)
|
||||||
QFile *file;
|
QFile *file;
|
||||||
char *m, *p;
|
char *m, *p;
|
||||||
int zip = 0;
|
int zip = 0;
|
||||||
|
int len = strlen (mode);
|
||||||
|
|
||||||
m = alloca (strlen (mode) + 1);
|
m = alloca (len + 1);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
setmode (fd, O_BINARY);
|
setmode (fd, O_BINARY);
|
||||||
#endif
|
#endif
|
||||||
for (p = m; *mode && p - m < ((int) sizeof (m) - 1); mode++) {
|
for (p = m; *mode && p - m < len; mode++) {
|
||||||
if (*mode == 'z') {
|
if (*mode == 'z') {
|
||||||
zip = 1;
|
zip = 1;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue