libi2ncommon: (gerd) fix WEEK constructor
authorGerd v. Egidy <gerd.von.egidy@intra2net.com>
Sat, 4 Sep 2004 17:48:57 +0000 (17:48 +0000)
committerGerd v. Egidy <gerd.von.egidy@intra2net.com>
Sat, 4 Sep 2004 17:48:57 +0000 (17:48 +0000)
src/timefunc.cpp

index bd1049a..2ae3a25 100644 (file)
@@ -152,11 +152,13 @@ WEEK::WEEK(const std::string& daystring)
     int len=daystring.length();
     for (int p=0; p < len; p++)
     {
-        char nr=daystring[p];
-        istringstream c(&nr);
+        char nr[2];
+        nr[0]=daystring[p];
+        nr[1]=0;
+        istringstream c(nr);
         int wnr=-1;
         if (!(c >> wnr) || wnr<0 || wnr >6)
-            throw out_of_range("illegal weekday in "+daystring);
+            throw range_error("illegal weekday >"+string(nr)+"< in "+daystring);
             
         days.set(wnr);
     }