on master help sign in
26 lines 518 B history raw
1#include <stdio.h>
2#include <stdlib.h>
3#include <string.h>
4#include "hexml.c"
6int main(int ac, char** av)
7{
8#ifdef __AFL_HAVE_MANUAL_CONTROL
9 __AFL_INIT();
10#endif
12 FILE *f = fopen(av[1], "rb");
13 fseek(f, 0, SEEK_END);
14 size_t fsize = ftell(f);
15 rewind(f);
17 char* string = malloc(fsize+1);
18 memset(string, 0, fsize+1);
19 (void) fread(string, fsize, 1, f);
20 fclose(f);
22 document *doc = hexml_document_parse(string, fsize);
23 hexml_document_free(doc);
24 free(string);
25 return 0;