Changed G_LoadServerChangeFile from fixed buffer size to dynamic buffer size

This commit is contained in:
Walter Julius Hennecke 2013-05-16 22:05:18 +02:00
parent 02b60d67ca
commit d3bd8eaf79
1 changed files with 2 additions and 2 deletions

View File

@ -1100,9 +1100,9 @@ static void G_LoadServerChangeFile(void) {
}
// TODO dynamic buffer size
buffer = (char *)malloc(32000 * sizeof(char));
buffer = (char *)malloc((file_len + 1) * sizeof(char));
if(!buffer) {
G_Printf(S_COLOR_RED "ERROR: Was unable to allocate %i bytes.\n", 32000 * sizeof(char) );
G_Printf(S_COLOR_RED "ERROR: Was unable to allocate %i bytes.\n", (file_len + 1) * sizeof(char) );
trap_FS_FCloseFile(f);
return;
}