[common] use variable-relative sizeof where possible

This commit is contained in:
Tudor Brindus
2021-08-15 12:18:12 -04:00
committed by Geoffrey McRae
parent 982b4e6625
commit 1c5620ba25
11 changed files with 21 additions and 23 deletions

View File

@@ -24,7 +24,7 @@
struct CountedBuffer * countedBufferNew(size_t size)
{
struct CountedBuffer * buffer = malloc(sizeof(struct CountedBuffer) + size);
struct CountedBuffer * buffer = malloc(sizeof(*buffer) + size);
if (!buffer)
return NULL;