summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@enzo.thebackupbox.net>2021-03-16 12:46:13 -0500
committerepoch <epoch@enzo.thebackupbox.net>2021-03-16 12:46:13 -0500
commite37893cabfe8bb251a1c2978f902623ca5ace7d5 (patch)
treef12c29dabdd92ba07ff74c7115c1cb7940fdad4a
parentf9d2af58fb6fd3b1ec47bd5c810816e787323c71 (diff)
downloaduritools-e37893cabfe8bb251a1c2978f902623ca5ace7d5.tar.gz
uritools-e37893cabfe8bb251a1c2978f902623ca5ace7d5.zip
/something/ causes uriunescape to mess up when the output buffer is the same as the input buffer.
-rw-r--r--uriunescape.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/uriunescape.c b/uriunescape.c
index c99cdfc..23800a5 100644
--- a/uriunescape.c
+++ b/uriunescape.c
@@ -9,12 +9,14 @@ int main(int argc,char *argv[]) {
int len;
char buf[BUFSIZE];
char buf2[BUFSIZE];
+ char *ab;
int blen;
int hack;
if(argc > 1) {
for(argv++,argc--;argc;argc--,argv++) {
- len=uriunescape(*argv,*argv);
- write(1,*argv,len);
+ ab=malloc(strlen(*argv));
+ len=uriunescape(*argv,ab);
+ write(1,ab,len);
if(argc-1) write(1," ",1);
}
} else {