File: misc.c

package info (click to toggle)
debsig-verify 0.8
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 140 kB
  • sloc: ansic: 770; makefile: 71
file content (58 lines) | stat: -rw-r--r-- 1,552 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * debsig-verify - Debian package signature verification tool
 *
 * Copyright (c) 2000 by Ben Collins <bcollins@debian.org>
 *
 * This Program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This Program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this Program; see the file COPYING.  If not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA 02111-1307, USA.
 */

/* $Id: misc.c,v 1.4 2000/12/12 22:44:10 bcollins Exp $
 * miscellaneous functions
 */

#include <stdio.h>
#include <stdarg.h>

#include "debsig.h"

int ds_debug_level = 1;

void ds_printf(int level, const char *fmt, ...) {
    va_list ap;
    char buf[8096];

    if (level >= ds_debug_level) {
	va_start(ap, fmt);
	snprintf(buf, sizeof(buf) - 1, "debsig: %s\n", fmt);
	(void) vprintf (buf, ap);
	va_end(ap);
    }

    return;
}

int checkSigExist(const char *name) {
    char buf[16];

    if (name == NULL) {
	ds_printf(DS_LEV_DEBUG, "checkSigExist: NULL values passed");
	return 0;
    }

    snprintf(buf, sizeof(buf) - 1, "_gpg%s", name);

    return findMember(buf);
}