Fix snprintf() overflow issues