2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 09:56:22 +01:00

engine: common: fix fragbuf_t definition so it has true standard flexible array member

This commit is contained in:
Alibek Omarov 2024-08-08 06:11:52 +03:00
parent e9ee4beb9f
commit bd2a44dbdd
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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