source: zzuf/trunk/src/debug.c @ 1532

Last change on this file since 1532 was 1527, checked in by Sam Hocevar, 16 years ago
  • Factored regex matching stuff.
  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1/*
2 *  zzuf - general purpose fuzzer
3 *  Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
4 *                All Rights Reserved
5 *
6 *  $Id: debug.c 1527 2006-12-29 17:49:11Z sam $
7 *
8 *  This program is free software. It comes without any warranty, to
9 *  the extent permitted by applicable law. You can redistribute it
10 *  and/or modify it under the terms of the Do What The Fuck You Want
11 *  To Public License, Version 2, as published by Sam Hocevar. See
12 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13 */
14
15/*
16 *  debug.c: debugging support
17 */
18
19#include "config.h"
20
21#if defined HAVE_STDINT_H
22#   include <stdint.h>
23#elif defined HAVE_INTTYPES_H
24#   include <inttypes.h>
25#endif
26#include <stdio.h>
27#include <errno.h>
28#include <stdarg.h>
29
30#include "debug.h"
31
32extern int _zz_hasdebug;
33
34void _zz_debug(const char *format, ...)
35{
36    va_list args;
37    int saved_errno;
38
39    if(!_zz_hasdebug)
40        return;
41
42    saved_errno = errno;
43    va_start(args, format);
44    fprintf(stderr, "** zzuf debug ** ");
45    vfprintf(stderr, format, args);
46    fprintf(stderr, "\n");
47    va_end(args);
48    errno = saved_errno;
49}
50
Note: See TracBrowser for help on using the repository browser.