Fix snprintf compiler warning in hexdump BIF

This commit is contained in:
Jon Siwek 2020-01-06 12:29:03 -08:00
parent 50d91b17de
commit 99faaf811d

View file

@ -1097,7 +1097,7 @@ function hexdump%(data_str: string%) : string
{ {
char offset[5]; char offset[5];
snprintf(offset, sizeof(offset), snprintf(offset, sizeof(offset),
"%.4x", data_ptr - data); "%.4tx", data_ptr - data);
memcpy(hex_data_ptr, offset, 4); memcpy(hex_data_ptr, offset, 4);
hex_data_ptr += 6; hex_data_ptr += 6;
ascii_ptr = hex_data_ptr + 50; ascii_ptr = hex_data_ptr + 50;