mirror of
https://github.com/kiedtl/fire.git
synced 2024-12-22 14:16:43 +00:00
draw.c: use calloc instead of malloc
This commit is contained in:
parent
6c076eb2a9
commit
f0db1af7a5
2
draw.c
2
draw.c
@ -26,7 +26,7 @@ init(struct buffer *buf)
|
|||||||
buf->height = tb_height();
|
buf->height = tb_height();
|
||||||
|
|
||||||
size_t len = buf->width * buf->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;
|
len -= buf->width;
|
||||||
|
|
||||||
if (buf->buf == NULL) {
|
if (buf->buf == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user