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.
This commit is contained in:
Anatol Belski 2017-11-15 18:02:01 +01:00
parent 4764574910
commit 6f41ca4de1

View File

@ -37,7 +37,7 @@ DIR *opendir(const char *dir)
return NULL;
}
dp = (DIR *) calloc(1, sizeof(DIR) + MAXPATHLEN*sizeof(char));
dp = (DIR *) calloc(1, sizeof(DIR) + (_MAX_FNAME*5+1)*sizeof(char));
if (dp == NULL) {
return NULL;
}