draw.c: use calloc instead of malloc

This commit is contained in:
Kiëd Llaentenn 2020-09-17 12:06:16 +00:00
parent 6c076eb2a9
commit f0db1af7a5

2
draw.c
View File

@ -26,7 +26,7 @@ init(struct buffer *buf)
buf->height = tb_height();
size_t len = buf->width * buf->height;
buf->buf = (uint8_t*) malloc(len);
buf->buf = (uint8_t*) calloc(len, sizeof(uint8_t));
len -= buf->width;
if (buf->buf == NULL) {