From e37893cabfe8bb251a1c2978f902623ca5ace7d5 Mon Sep 17 00:00:00 2001 From: epoch Date: Tue, 16 Mar 2021 12:46:13 -0500 Subject: /something/ causes uriunescape to mess up when the output buffer is the same as the input buffer. --- uriunescape.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'uriunescape.c') 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 { -- cgit v1.2.3