summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-02-13 12:56:43 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2015-02-13 12:56:43 +0100
commitaec6b3361b3de8391177261469da6edafd39a080 (patch)
treec52a9a63dc078fbd0c8ee209eed03f8fe5655b7a /src/drumgizmo.cc
parent1971b7c898f710df4d66e0a70e2ec707ab6e18fd (diff)
Fix locale sensitive float parsing/printing.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r--src/drumgizmo.cc6
1 files changed, 4 insertions, 2 deletions
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()