diff --git a/TODO b/TODO index b54b402..6015942 100644 --- a/TODO +++ b/TODO @@ -16,9 +16,7 @@ Stuff to do before 0.4.6 release: * work in xboxdrv-hal demon to launch things -* Recalibrate: CalibrationModifier - - --calibration X2=min:center:max +* boost::tokenizer is broken on 64bit Stuff to do before 0.5 release: diff --git a/src/modifier.cpp b/src/modifier.cpp index bfc008e..5710165 100644 --- a/src/modifier.cpp +++ b/src/modifier.cpp @@ -85,7 +85,8 @@ CalibrationMapping CalibrationMapping::from_string(const std::string& str) boost::char_separator<char> sep(":", "", boost::keep_empty_tokens); typedef boost::tokenizer<boost::char_separator<char> > tokenizer; - tokenizer tokens(str.substr(epos+1), sep); + std::string rhs = str.substr(epos+1); + tokenizer tokens(rhs, sep); int j = 0; for(tokenizer::iterator i = tokens.begin(); i != tokens.end(); ++i, ++j) { @@ -103,7 +104,7 @@ CalibrationMapping CalibrationMapping::from_string(const std::string& str) mapping.max = boost::lexical_cast<int>(*i); else throw std::runtime_error("--calibration: to many arguments given, syntax is 'AXIS=MIN:CENTER:MAX': " + str); - } + } catch(boost::bad_lexical_cast&) { throw std::runtime_error("--calibration: couldn't convert '" + *i + "' to int");