fwrite_le.c: use malloc
instead of calloc
This commit is contained in:
parent
ba5d489352
commit
fc5612219d
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user