fix bug, use `snprintf` in a incorrect way