Skip to content

Commit

Permalink
COMMON: Use actual size 3 instead of SIZE_MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
HappySeaFox committed Nov 4, 2023
1 parent f58dedd commit 1a98941
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sail-common/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,9 @@ sail_status_t sail_data_into_hex_string(const void *data, size_t data_size, char

for (size_t i = 0; i < data_size; i++) {
#ifdef _MSC_VER
sprintf_s(str_local_copy, SIZE_MAX, "%02X", data_local[data_local_index++]);
sprintf_s(str_local_copy, 3, "%02X", data_local[data_local_index++]);
#else
snprintf(str_local_copy, SIZE_MAX, "%02X", data_local[data_local_index++]);
snprintf(str_local_copy, 3, "%02X", data_local[data_local_index++]);
#endif
str_local_copy += 2;
}
Expand Down

0 comments on commit 1a98941

Please sign in to comment.