Skip to content

Commit

Permalink
COMMON: Use snprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
HappySeaFox committed Nov 4, 2023
1 parent 51948e9 commit f58dedd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sail-common/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ sail_status_t sail_data_into_hex_string(const void *data, size_t data_size, char
#ifdef _MSC_VER
sprintf_s(str_local_copy, SIZE_MAX, "%02X", data_local[data_local_index++]);
#else
sprintf(str_local_copy, "%02X", data_local[data_local_index++]);
snprintf(str_local_copy, SIZE_MAX, "%02X", data_local[data_local_index++]);
#endif
str_local_copy += 2;
}
Expand Down
2 changes: 1 addition & 1 deletion src/sail/codec_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ sail_status_t sail_codec_info_by_magic_number_from_io(struct sail_io *io, const
#ifdef _MSC_VER
sprintf_s(hex_numbers_ptr, 4, "%02x ", buffer[i]);
#else
sprintf(hex_numbers_ptr, "%02x ", buffer[i]);
snprintf(hex_numbers_ptr, 4, "%02x ", buffer[i]);
#endif
}

Expand Down

0 comments on commit f58dedd

Please sign in to comment.