source: zzuf/trunk/src/opts.c @ 4253

Last change on this file since 4253 was 4253, checked in by sam, 5 years ago

Fix copyright information and remove Id tag everywhere.

  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1/*
2 *  zzuf - general purpose fuzzer
3 *  Copyright (c) 2002-2010 Sam Hocevar <sam@hocevar.net>
4 *                All Rights Reserved
5 *
6 *  This program is free software. It comes without any warranty, to
7 *  the extent permitted by applicable law. You can redistribute it
8 *  and/or modify it under the terms of the Do What The Fuck You Want
9 *  To Public License, Version 2, as published by Sam Hocevar. See
10 *  http://sam.zoy.org/wtfpl/COPYING for more details.
11 */
12
13/*
14 *  opts.c: configuration handling
15 */
16
17#include "config.h"
18
19#if defined HAVE_STDINT_H
20#   include <stdint.h>
21#elif defined HAVE_INTTYPES_H
22#   include <inttypes.h>
23#endif
24
25#include <sys/types.h>
26#include <stdio.h>
27#include <stdlib.h>
28
29#include "common.h"
30#include "opts.h"
31
32void _zz_opts_init(struct opts *opts)
33{
34    opts->fuzzing = opts->bytes = opts->list = opts->ports = NULL;
35    opts->allow = NULL;
36    opts->protect = opts->refuse = NULL;
37    opts->seed = DEFAULT_SEED;
38    opts->endseed = DEFAULT_SEED + 1;
39    opts->minratio = opts->maxratio = DEFAULT_RATIO;
40    opts->quiet = 0;
41    opts->maxbytes = -1;
42    opts->md5 = 0;
43    opts->checkexit = 0;
44    opts->verbose = 0;
45    opts->maxmem = DEFAULT_MEM;
46    opts->maxtime = -1;
47    opts->maxcpu = -1;
48    opts->delay = 0;
49    opts->lastlaunch = 0;
50
51    opts->newargv = NULL;
52    opts->maxchild = 1;
53    opts->nchild = 0;
54    opts->maxcrashes = 1;
55    opts->crashes = 0;
56    opts->child = NULL;
57}
58
59void _zz_opts_fini(struct opts *opts)
60{
61    if(opts->child)
62        free(opts->child);
63    if(opts->newargv)
64        free(opts->newargv);
65}
66
Note: See TracBrowser for help on using the repository browser.