moved mem2str to string_utils.c