Fix a sizeof braino.

Somebody (probably me) got a little over-happy with sizeof.
This commit is contained in:
Bill Currie 2010-11-14 19:22:47 +09:00
parent f63e505c92
commit 824e33c82b
1 changed files with 3 additions and 2 deletions

View File

@ -216,12 +216,13 @@ Qdopen (int fd, const char *mode)
QFile *file;
char *m, *p;
int zip = 0;
int len = strlen (mode);
m = alloca (strlen (mode) + 1);
m = alloca (len + 1);
#ifdef _WIN32
setmode (fd, O_BINARY);
#endif
for (p = m; *mode && p - m < ((int) sizeof (m) - 1); mode++) {
for (p = m; *mode && p - m < len; mode++) {
if (*mode == 'z') {
zip = 1;
continue;