浏览代码

getDouble corrected

Wolfgang Ortmann 9 年之前
父节点
当前提交
e7eeb3bb86
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/stringtools.cpp

+ 2 - 2
src/stringtools.cpp

@@ -126,8 +126,8 @@ long int getLongInt(const string& s, unsigned int& i)
 
 double getDouble(const string& s, unsigned int& i)
 {
-  if (!isdigit(s[i])||s[i]=='-')
-    throw Exception("getDouble", "digit expected");
+  if (!isdigit(s[i]) && s[i]!='-')
+    throw Exception("getDouble", "digit expected in " );
   string is;
   while (i < s.size() && (isdigit(s[i]) || s[i]=='-' || s[i]=='.' || s[i]=='e' || s[i]=='E'))
     {