draw.c: remove redundant memset

This commit is contained in:
Kiëd Llaentenn 2020-09-17 12:07:24 +00:00
parent f0db1af7a5
commit 5adc07df8f

6
draw.c
View File

@ -30,14 +30,12 @@ init(struct buffer *buf)
len -= buf->width; len -= buf->width;
if (buf->buf == NULL) { if (buf->buf == NULL) {
PRINT("fire: cannot "); EPRINT("fire: cannot ");
perror("calloc()"); perror("calloc()");
exit(1); exit(1);
} }
// initialize the entire screen to black... // calloc sets the entire screen to black
memset(buf->buf, 0, len);
// ...except for the last row, which is white. // ...except for the last row, which is white.
// this is the 'base' of the fire. // this is the 'base' of the fire.
memset(buf->buf + len, 12, buf->width); memset(buf->buf + len, 12, buf->width);