Added snprintf to the program to make it safe...