Updates for snprintf.
Modified snprintf so that no field separator is printed after last field.