Fix sprintf warnings on macOS

The most recent compiler update for macOS marked sprintf as
deprecated, so we started getting warnings from all of the places
that use it.
This commit is contained in:
Tim Wojtulewicz 2022-12-16 14:06:03 -07:00
parent 35f5646489
commit 797b7657f5
5 changed files with 13 additions and 9 deletions

View file

@ -215,7 +215,7 @@ char* String::Render(int format, int* len) const
*sp++ = '\\';
*sp++ = 'x';
sprintf(hex_fmt, "%02x", b[i]);
snprintf(hex_fmt, 16, "%02x", b[i]);
*sp++ = hex_fmt[0];
*sp++ = hex_fmt[1];
}