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

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