From aec6b3361b3de8391177261469da6edafd39a080 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 13 Feb 2015 12:56:43 +0100 Subject: Fix locale sensitive float parsing/printing. --- src/drumgizmo.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/drumgizmo.cc') diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index 6b48cda..5d7de70 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -43,6 +43,8 @@ #include "configuration.h" #include "configparser.h" +#include "nolocale.h" + DrumGizmo::DrumGizmo(AudioOutputEngine *o, AudioInputEngine *i) : MessageReceiver(MSGRCV_ENGINE), loader(), oe(o), ie(i) @@ -451,7 +453,7 @@ void DrumGizmo::setSamplerate(int samplerate) std::string float2str(float a) { char buf[256]; - sprintf(buf, "%f", a); + snprintf_nol(buf, sizeof(buf) - 1, "%f", a); return buf; } @@ -463,7 +465,7 @@ std::string bool2str(bool a) float str2float(std::string a) { if(a == "") return 0.0; - return atof(a.c_str()); + return atof_nol(a.c_str()); } std::string DrumGizmo::configString() -- cgit v1.2.3