Don't process drums if no steps.

Possible problem identified by 'scan-build' / Ville Skyttä
Whitespace formatting fix.
Allocate one more space than required.

- Solves: If size is zero, can still store the string null termination [q[j] = '\0';]
Don't confuse static analysers

- match sizeof() with return type of malloc
- keep 2*byte size to store 16 bit values.
Improve portability of malloc, and fully clear the BYTE** array
Remove old comments regarding CHAR->char change.
In CSoundFile::SetPatternName, check input argument lpszName for NULL.
Don't initialize variables twice
If wave_size is zero, explicitly set p variable to NULL (don't rely on malloc behaviour)
Don't access h after MID_cleanup
Don't use smplflags unless SMPI section has been loaded.
Match calloc types to variables
Improve ABC detection code.

Don't assume binary if get a new line early on.
If no h->track exists, don't use certain code

- don't read patterns
- don't try adding a partbreak
Reformat file.
If read is truncated, read zeros for the remaining part of the buffer.
Avoid possibility of divide by zero.
Remove use of derr, as it is unused.
Use uint32_t for 32bit number

- avoid size changing on different architectures (64bit vs 32bit etc)
Abort if file size is zero