Skip to content

Commit

Permalink
PNG: Use snprintf()
Browse files Browse the repository at this point in the history
  • Loading branch information
HappySeaFox committed Dec 17, 2022
1 parent ba819c7 commit 9719fc9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/sail-codecs/png/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9719fc9

Please sign in to comment.