diff options
author | Erik <erik_newton@hotmail.com> | 2023-02-19 17:24:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-20 04:24:34 +1100 |
commit | 32f48ebb75f4fefcc7bcf0482289c0afa57d9973 (patch) | |
tree | a8c5b68a90a2c29be7dd7a49f13506c4fcddaeed /src/frontend/mame/ui | |
parent | a547f50515ea037d11b5725591718ea1a7a66456 (diff) |
Reduced usage of sprintf. (#10892)
Diffstat (limited to 'src/frontend/mame/ui')
-rw-r--r-- | src/frontend/mame/ui/viewgfx.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/frontend/mame/ui/viewgfx.cpp b/src/frontend/mame/ui/viewgfx.cpp index 2fcc0949484..56dfd008893 100644 --- a/src/frontend/mame/ui/viewgfx.cpp +++ b/src/frontend/mame/ui/viewgfx.cpp @@ -1003,8 +1003,7 @@ uint32_t gfx_viewer::handle_palette(mame_ui_manager &mui, render_container &cont container.add_point(0.5f * (x0 + cellboxbounds.x0), y0 + 0.5f * cellheight, UI_LINE_WIDTH, rgb_t::white(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); // draw the row header - char buffer[10]; - sprintf(buffer, "%5X", index); + auto buffer = util::string_format("%5X", index); for (int x = 4; x >= 0; x--) { x0 -= ui_font->char_width(chheight, aspect, buffer[x]); @@ -1209,8 +1208,7 @@ uint32_t gfx_viewer::handle_gfxset(mame_ui_manager &mui, render_container &conta container.add_point(0.5f * (x0 + boxbounds.x0 + 6.0f * chwidth), y0 + 0.5f * cellheight, UI_LINE_WIDTH, rgb_t::white(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); // draw the row header - char buffer[10]; - sprintf(buffer, "%5X", set.m_offset + (y * xcells)); + auto buffer = util::string_format("%5X", set.m_offset + (y * xcells)); for (int x = 4; x >= 0; x--) { x0 -= ui_font->char_width(chheight, aspect, buffer[x]); |