Skip to content

Commit 6f41ca4

Browse files
committed
Refine allocation
None of currently supported codepages would claim more than 5 bytes per a multibyte glyph, that's (255*5+1)kb, not 2kb anymore.
1 parent 4764574 commit 6f41ca4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

win32/readdir.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ DIR *opendir(const char *dir)
3737
return NULL;
3838
}
3939

40-
dp = (DIR *) calloc(1, sizeof(DIR) + MAXPATHLEN*sizeof(char));
40+
dp = (DIR *) calloc(1, sizeof(DIR) + (_MAX_FNAME*5+1)*sizeof(char));
4141
if (dp == NULL) {
4242
return NULL;
4343
}

0 commit comments

Comments
 (0)