projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f53765d
)
Changed sscanf in urldecode to use more portable scan-spec.
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 7 Jul 2008 07:25:28 +0000
(09:25 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 7 Jul 2008 07:25:28 +0000
(09:25 +0200)
Changed sscanf in urldecode to use more portable scan spec. This fixes
the %XX decoding on Windows.
src/http.c
patch
|
blob
|
history
diff --git
a/src/http.c
b/src/http.c
index
642465f
..
ec72838
100644
(file)
--- a/
src/http.c
+++ b/
src/http.c
@@
-230,12
+230,13
@@
static void urldecode(char *i, char *o)
*(o++) = ' ';
i++;
}
- else if (*i == '%')
+ else if (*i == '%' && i[1] && i[2])
{
+ int v;
i++;
- sscanf(i, "%2hhx", o);
+ sscanf(i, "%2x", &v);
+ *o++ = v;
i += 2;
- o++;
}
else
*(o++) = *(i++);