-rw-r--r-- | include/opkele/iterator.h | 2 | ||||
-rw-r--r-- | lib/util.cc | 2 |
2 files changed, 2 insertions, 2 deletions
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 @@ -98,17 +98,17 @@ namespace opkele { template<typename IT> forward_iterator_proxy(const IT& i) : I(new forward_iterator_proxy_impl<IT>(i)) { } forward_iterator_proxy(const forward_iterator_proxy<T,TR,TP>& x) : I(x.I->dup()) { } ~forward_iterator_proxy() { delete I; } forward_iterator_proxy& operator=(const forward_iterator_proxy<T,TR,TP>& x) { - delete I; I = x.I->dup(); } + delete I; I = x.I->dup(); return *this; } bool operator==(const forward_iterator_proxy<T,TR,TP>& x) const { return (*I)==(*(x.I)); } bool operator!=(const forward_iterator_proxy<T,TR,TP>& x) const { return (*I)!=(*(x.I)); } TR operator*() const { return **I; } diff --git a/lib/util.cc b/lib/util.cc index a46ba2a..249eeed 100644 --- a/lib/util.cc +++ b/lib/util.cc @@ -205,24 +205,24 @@ namespace opkele { for_each(str.begin(),str.end(), __url_encoder(rv)); return rv; } string url_decode(const string& str) { string rv; back_insert_iterator<string> ii(rv); + char tmp[3]; tmp[2] = 0; for(string::const_iterator i=str.begin(),ie=str.end(); i!=ie;++i) { switch(*i) { case '+': *(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++); if(i==ie) throw failed_conversion(OPKELE_CP_ "not enough hexadecimals after the percent sign in url-encoded string"); tmp[1] = *i; if(!(isxdigit(tmp[0]) && isxdigit(tmp[1]))) throw failed_conversion(OPKELE_CP_ "non-hex follows percent in url-encoded string"); |