Pass C strings as const char*
Don't include deprecated malloc.h
These are not pointers
sprintf() requires C string, not std::string
Fix return type
Merge pull request #1 from AMDmi3/build-error-fixes

Fix assorted build errors on FreeBSD