SECURE_CODING: Use snprintf/write_fmt_str instead of sprintf