renamed snprintf to str_printf - define collision on Microsoft platform (#define snprintf _snprintf)