malloc() is a memory allocation function that accepts the number of bytes to allocate as the parameter.
memset() is a function to store data at a specific address; 'buf' being the destination, '0' being the data to store, and maxLen+1 being the size of the data to store. The purpose of this is...