since snprintf can handle NULL pointer but sprintf can't. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>