diff --git a/engine/common/net_chan.c b/engine/common/net_chan.c index 1043ab32..7c1a4985 100644 --- a/engine/common/net_chan.c +++ b/engine/common/net_chan.c @@ -513,7 +513,7 @@ static fragbuf_t *Netchan_AllocFragbuf( int fragment_size ) { fragbuf_t *buf; - buf = (fragbuf_t *)Mem_Calloc( net_mempool, sizeof( fragbuf_t ) + ( fragment_size - 1 ) ); + buf = (fragbuf_t *)Mem_Calloc( net_mempool, sizeof( fragbuf_t ) + fragment_size ); MSG_Init( &buf->frag_message, "Frag Message", buf->frag_message_buf, fragment_size ); return buf; diff --git a/engine/common/netchan.h b/engine/common/netchan.h index 0c2a76ea..d6335341 100644 --- a/engine/common/netchan.h +++ b/engine/common/netchan.h @@ -190,7 +190,7 @@ typedef struct fragbuf_s char filename[MAX_OSPATH]; // name of the file to save out on remote host int foffset; // offset in file from which to read data int size; // size of data to read at that offset - byte frag_message_buf[1]; // the actual data sits here (flexible) + byte frag_message_buf[]; // the actual data sits here (flexible) } fragbuf_t; // Waiting list of fragbuf chains