Check for point_pos == -1

feature/19
Daniel Warner 2014-03-08 18:46:42 +00:00
parent f588fb5cdf
commit cf6fde478c
1 changed files with 2 additions and 2 deletions

View File

@ -215,7 +215,7 @@ void Tle::ExtractDouble(const std::string& str, int point_pos, double& val)
/*
* integer part
*/
if (i < str.begin() + point_pos - 1)
if (point_pos >= 0 && i < str.begin() + point_pos - 1)
{
bool done = false;
@ -251,7 +251,7 @@ void Tle::ExtractDouble(const std::string& str, int point_pos, double& val)
/*
* decimal point
*/
else if (i == str.begin() + point_pos - 1)
else if (point_pos >= 0 && i == str.begin() + point_pos - 1)
{
if (temp.length() == 0)
{