summaryrefslogtreecommitdiff
path: root/uriescape.c
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2019-04-20 05:32:27 -0500
committerepoch <epoch@hacking.allowed.org>2019-04-20 05:32:27 -0500
commit6f402e2d2f052972886712f60d592684c8671982 (patch)
tree47a09324bd3c5e577ec5b7059bd6c8834bead115 /uriescape.c
parentd42135919f480c8bba4ca1f043fbabf44dac708f (diff)
downloaduritools-6f402e2d2f052972886712f60d592684c8671982.tar.gz
uritools-6f402e2d2f052972886712f60d592684c8671982.zip
rebased on an old copy of this repo. renamed everything. rewrote the uri parser. added uricmp. wew.
Diffstat (limited to 'uriescape.c')
-rw-r--r--uriescape.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/uriescape.c b/uriescape.c
new file mode 100644
index 0000000..da3da7e
--- /dev/null
+++ b/uriescape.c
@@ -0,0 +1,14 @@
+#include "uri.h"
+#include <stdio.h>
+
+int main(int argc,char *argv[]) {
+ int len;
+ char *out;
+ if(argc < 2) return 1;
+ len=uriescapelength(argv[1],strlen(argv[1]));
+ out=malloc(len+1);
+ uriescape(argv[1],out,len);
+ out[len]=0;
+ printf("%s\n",out);
+ return 0;
+}