mirror of
https://github.com/mintycube/st.git
synced 2024-10-22 14:05:49 +02:00
background image: use xmalloc instead of malloc to exit st on malloc failures
This commit is contained in:
parent
faac64e392
commit
289485bd50
@ -35,7 +35,7 @@ loadff(const char *filename)
|
||||
w = ntohl(hdr[2]);
|
||||
h = ntohl(hdr[3]);
|
||||
size = w * h;
|
||||
data = malloc(size * sizeof(uint64_t));
|
||||
data = xmalloc(size * sizeof(uint64_t));
|
||||
|
||||
if (fread(data, sizeof(uint64_t), size, f) != size) {
|
||||
fprintf(stderr, "fread: %s\n", ferror(f) ? "" : "Unexpected end of file reading data");
|
||||
|
Loading…
Reference in New Issue
Block a user