snprintf() was replaced to ostringstream