summaryrefslogtreecommitdiff
path: root/src/gui/profilergraph.cpp
diff options
context:
space:
mode:
authornOOb3167 <nOOb3167@gmail.com>2018-07-22 21:56:06 +0200
committerSmallJoker <SmallJoker@users.noreply.github.com>2018-07-22 21:56:06 +0200
commit9537cfd3f8264700619f58d15741829489e1099e (patch)
tree36412677aba19e1a2037db7fad2f934a2daa5046 /src/gui/profilergraph.cpp
parent9855651c06f84f29780cf6b25a392ac841b4630c (diff)
downloadminetest-9537cfd3f8264700619f58d15741829489e1099e.tar.gz
minetest-9537cfd3f8264700619f58d15741829489e1099e.tar.bz2
minetest-9537cfd3f8264700619f58d15741829489e1099e.zip
Add a MSVC / Windows compatible snprintf function (#7353)
Use sizeof where applicable for mt_snprintf
Diffstat (limited to 'src/gui/profilergraph.cpp')
-rw-r--r--src/gui/profilergraph.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/profilergraph.cpp b/src/gui/profilergraph.cpp
index 740dfa35c..b29285e2f 100644
--- a/src/gui/profilergraph.cpp
+++ b/src/gui/profilergraph.cpp
@@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include "porting.h"
#include "profilergraph.h"
#include "util/string.h"
@@ -95,12 +96,12 @@ void ProfilerGraph::draw(s32 x_left, s32 y_bottom, video::IVideoDriver *driver,
s32 texth = 15;
char buf[10];
- snprintf(buf, 10, "%.3g", show_max);
+ porting::mt_snprintf(buf, sizeof(buf), "%.3g", show_max);
font->draw(utf8_to_wide(buf).c_str(),
core::rect<s32>(textx, y - graphh, textx2,
y - graphh + texth),
meta.color);
- snprintf(buf, 10, "%.3g", show_min);
+ porting::mt_snprintf(buf, sizeof(buf), "%.3g", show_min);
font->draw(utf8_to_wide(buf).c_str(),
core::rect<s32>(textx, y - texth, textx2, y), meta.color);
font->draw(utf8_to_wide(id).c_str(),