1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Fixed a wrong return code with gpg --verify

This commit is contained in:
Werner Koch 2006-02-14 10:17:57 +00:00
parent 2410941461
commit 966cd80d88
13 changed files with 121 additions and 41 deletions

View file

@ -1,3 +1,7 @@
2006-02-14 Werner Koch <wk@gnupg.org>
* mk-tdata.c (main): Implement option --char.
2005-08-05 David Shaw <dshaw@jabberwocky.com>
* gpg-zip.in: Add --decrypt functionality. Fix quoting so

View file

@ -1,5 +1,5 @@
/* mk-tdata.c - Create some simple random testdata
* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
* Copyright (C) 1998, 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
*
* This file is free software; as a special exception the author gives
* unlimited permission to copy and/or distribute it, with or without
@ -13,6 +13,7 @@
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@ -23,20 +24,44 @@
int
main(int argc, char **argv)
{
int i, c;
int limit =0;
int i, c = 0;
int limit =0;
int char_mode = 0;
limit = argc > 1 ? atoi(argv[1]) : 0;
srand(getpid());
for(i=0; !limit || i < limit; i++ ) {
#ifdef HAVE_RAND
c = ((unsigned)(1 + (int) (256.0*rand()/(RAND_MAX+1.0)))-1);
#else
c = ((unsigned)(1 + (int) (256.0*random()/(RAND_MAX+1.0)))-1);
#endif
putchar(c);
if (argc)
{
argc--;
argv++;
}
return 0;
/* Check for option --char N */
if (argc > 1 && !strcmp (argv[0], "--char"))
{
char_mode = 1;
c = strtol (argv[1], NULL, 0);
argc -= 2;
argv += 2;
}
limit = argc ? atoi(argv[0]) : 0;
srand(getpid());
for (i=0; !limit || i < limit; i++ )
{
if (char_mode)
{
putchar (c);
}
else
{
#ifdef HAVE_RAND
c = ((unsigned)(1 + (int) (256.0*rand()/(RAND_MAX+1.0)))-1);
#else
c = ((unsigned)(1 + (int) (256.0*random()/(RAND_MAX+1.0)))-1);
#endif
putchar (c);
}
}
return 0;
}