Find the size bug in this generated array-copy function.
C
#include <stddef.h>
#include <stdlib.h>
int *copy_readings(const int *source, size_t count) {
int *copy = (int *)malloc(count * sizeof *copy);
if (copy == NULL) {
return NULL;
}
for (size_t index = 0; index < count; ++index) {
copy[index] = source[index];
}
return copy;
}