From 9719fc93769f45fef91b1163c9d861d3cc77a851 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshev Date: Sat, 17 Dec 2022 14:06:19 -0800 Subject: [PATCH] PNG: Use snprintf() --- src/sail-codecs/png/helpers.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/sail-codecs/png/helpers.c b/src/sail-codecs/png/helpers.c index 487855b3..75809e66 100644 --- a/src/sail-codecs/png/helpers.c +++ b/src/sail-codecs/png/helpers.c @@ -79,12 +79,7 @@ static sail_status_t write_raw_profile_header(char *str, size_t str_size, enum S } /* Write "\nexif\n 1234\n" before the actual HEX-encoded data. */ -#ifdef _MSC_VER - if (sprintf_s(str, str_size, "\n%s\n %u\n", key_str, (unsigned)hex_data_length) < 0) { -#else - (void)str_size; - if (sprintf(str, "\n%s\n %u\n", key_str, (unsigned)hex_data_length) < 0) { -#endif + if (snprintf(str, str_size, "\n%s\n %u\n", key_str, (unsigned)hex_data_length) < 0) { SAIL_LOG_ERROR("PNG: Failed to save raw profile header"); SAIL_LOG_AND_RETURN(SAIL_ERROR_INVALID_ARGUMENT); }