From 4522de61114018633f66492e2e9977cdb3108098 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Mon, 22 Sep 2008 20:08:35 +0000 Subject: A couple of bugfixes - added missing 'return' statement to the forward_iterator_proxy operator=() - made temporary non-static for thread safety in url_decode() Thanks to Masato Kataoka of orenosv project Signed-off-by: Michael Krelin --- diff --git a/include/opkele/iterator.h b/include/opkele/iterator.h index 8f86234..94da7e4 100644 --- a/include/opkele/iterator.h +++ b/include/opkele/iterator.h @@ -103,7 +103,7 @@ namespace opkele { ~forward_iterator_proxy() { delete I; } forward_iterator_proxy& operator=(const forward_iterator_proxy& x) { - delete I; I = x.I->dup(); } + delete I; I = x.I->dup(); return *this; } bool operator==(const forward_iterator_proxy& x) const { return (*I)==(*(x.I)); } diff --git a/lib/util.cc b/lib/util.cc index a46ba2a..249eeed 100644 --- a/lib/util.cc +++ b/lib/util.cc @@ -210,6 +210,7 @@ namespace opkele { string url_decode(const string& str) { string rv; back_insert_iterator ii(rv); + char tmp[3]; tmp[2] = 0; for(string::const_iterator i=str.begin(),ie=str.end(); i!=ie;++i) { switch(*i) { @@ -217,7 +218,6 @@ namespace opkele { *(ii++) = ' '; break; case '%': ++i; - static char tmp[3] = {0,0,0}; if(i==ie) throw failed_conversion(OPKELE_CP_ "trailing percent in the url-encoded string"); tmp[0] = *(i++); -- cgit v0.9.0.2