summaryrefslogtreecommitdiff
path: root/uriescape.c
blob: ccf90cbf7f0d0f30db7a29223c6c5d6165b5ec69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "uri.h"
#include <stdio.h>

int main(int argc,char *argv[]) {
  int len;
  unsigned char *out;
  if(argc < 2) return 1;
  len=uriescapelength((unsigned char *)argv[1],strlen(argv[1]));
  out=malloc(len+1);
  uriescape((unsigned char *)argv[1],out,len);
  out[len]=0;
  printf("%s\n",out);
  return 0;
}