summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2019-06-16 10:57:33 -0500
committerepoch <epoch@hacking.allowed.org>2019-06-16 10:57:33 -0500
commit0eb5608223ed83a35734c86a99c57def93a9cfca (patch)
treef319171ee03d8004954a5a749603cddac3bca469
parent1f746b1bba3ee3eb797ed8db2747ef57f246c481 (diff)
downloaduritools-0eb5608223ed83a35734c86a99c57def93a9cfca.tar.gz
uritools-0eb5608223ed83a35734c86a99c57def93a9cfca.zip
removed a unneeded memmove from uriunescape and a trailing space
-rw-r--r--uri.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/uri.h b/uri.h
index aea3912..dc049bc 100644
--- a/uri.h
+++ b/uri.h
@@ -61,7 +61,6 @@ int uriunescape(char *in,char *out) {
char *t;
char a,b;
char *s=in;
- if(!strchr(s,'%')) memmove(out,in,strlen(in));
while((t=strchr(s,'%'))) {
if(t-s) {//if there are actually bytes to copy.
memmove(o,s,t-s);
@@ -72,7 +71,7 @@ int uriunescape(char *in,char *out) {
s+=3;//skip the %XX
a=toupper(t[1]);
b=toupper(t[2]);
- *o=((a-'0'<10 ? a-'0' : a-'A'+10) << 4) + (b-'0'<10 ? b-'0' : b-'A'+10);
+ *o=((a-'0'<10 ? a-'0' : a-'A'+10) << 4) + (b-'0'<10 ? b-'0' : b-'A'+10);
o++;
} else {
s++;//skip just the %. the next character might be a % //TODO: look up what the "right" thing to do here is.