Or, simpler and safer (replaces lines 874-878) : 
char precision_string[10];
snprintf(precision_string, 10, "%%.%df", precision);