summaryrefslogtreecommitdiffabout
path: root/lib/util.cc
Side-by-side diff
Diffstat (limited to 'lib/util.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/util.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/util.cc b/lib/util.cc
index a46ba2a..249eeed 100644
--- a/lib/util.cc
+++ b/lib/util.cc
@@ -207,20 +207,20 @@ namespace opkele {
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;