git://developer.intra2net.com
/
libi2ncommon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
3a488cb
)
libi2ncommon: (gerd) fix WEEK constructor
author
Gerd v. Egidy
<gerd.von.egidy@intra2net.com>
Sat, 4 Sep 2004 17:48:57 +0000 (17:48 +0000)
committer
Gerd v. Egidy
<gerd.von.egidy@intra2net.com>
Sat, 4 Sep 2004 17:48:57 +0000 (17:48 +0000)
src/timefunc.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/timefunc.cpp
b/src/timefunc.cpp
index
bd1049a
..
2ae3a25
100644
(file)
--- a/
src/timefunc.cpp
+++ b/
src/timefunc.cpp
@@
-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);
}