summaryrefslogtreecommitdiff
path: root/uriescape.c
blob: 20989418d73c9a9d1308a5e9f0c9531847a4cc7a (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,strlen(argv[1]));
  out[len]=0;
  printf("%s\n",out);
  return 0;
}