You are missing the inclusion of the <string.h>
header file.
The compiler even tells you what exactly your problem is:
return makes pointer from integer without a cast
If there's no prototype present for a function, then it's assumed to return int
. And it appears that on your platform, a pointer to char
does not fit into an int
, hence its truncated, and then printf()
tries to dereference the thus invalid pointer.