summaryrefslogtreecommitdiff
path: root/uriescape.c
blob: da3da7e221c46095589ee2653140bf4560e0bd77 (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;
  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;
}