1
0

fwrite_le.c: use malloc instead of calloc

This commit is contained in:
Intel A80486DX2-66 2024-07-14 00:11:31 +03:00
parent 56dd8dace3
commit 8192def161
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -65,9 +65,9 @@ size_t fwrite_le(
// case: big-endian // case: big-endian
size_t bytes_count = size * count; size_t bytes_count = size * count;
#if FWRITE_LE_NO_MODIFICATION #if FWRITE_LE_NO_MODIFICATION
uint8_t* bytes = calloc(bytes_count, sizeof(uint8_t)); uint8_t* bytes = malloc(bytes_count, sizeof(uint8_t));
if (bytes == NULL) { if (bytes == NULL) {
perror("calloc"); perror("malloc");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
memcpy(bytes, ptr, bytes_count); memcpy(bytes, ptr, bytes_count);