فهرست منبع

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'))
     {