From 5780c16004944fd29f8a37bf40a877cb15e51488 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 20 Oct 2018 08:50:09 +0200 Subject: Fix broken disk stream size limit in plugin config. --- plugin/drumgizmo_plugin.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'plugin') diff --git a/plugin/drumgizmo_plugin.cc b/plugin/drumgizmo_plugin.cc index 5614014..6e4fe3c 100644 --- a/plugin/drumgizmo_plugin.cc +++ b/plugin/drumgizmo_plugin.cc @@ -538,6 +538,18 @@ int str2int(std::string a) } } +long long str2ll(std::string a) +{ + try + { + return std::stoll(a); + } + catch(...) + { + return 0; + } +} + } // end anonymous namespace DrumGizmoPlugin::ConfigStringIO::ConfigStringIO(Settings& settings) @@ -638,7 +650,7 @@ bool DrumGizmoPlugin::ConfigStringIO::set(std::string config_string) if(p.value("disk_cache_upper_limit") != "") { - settings.disk_cache_upper_limit.store(str2int(p.value("disk_cache_upper_limit"))); + settings.disk_cache_upper_limit.store(str2ll(p.value("disk_cache_upper_limit"))); } if(p.value("disk_cache_chunk_size") != "") -- cgit v1.2.3