In the call to memset(), the size of the pointer to mag2buf was
erroneously used instead of size of what mag2buf pointed to (float).
This leads to problems on systems where the size of the pointer is
different from the size of floats. Instead of just fixing the size,
use calloc() instead of malloc() to directly set the memory to 0.