Initialize ffi buffers to 0 and handle possibility of return results being greater than the buffer size.