X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=splitkeys.c;h=4f6365596a2c3c1a692f3155adf5c61c5261f0da;hb=98ee16938c903e9d1d5bb9b720f9cfef1fa2ec0a;hp=a2daac673bbe1a6c2f13dc751deed7dc68921b35;hpb=4843e5290f2e7060ca5777c64b96e680080644f2;p=onak.git diff --git a/splitkeys.c b/splitkeys.c index a2daac6..4f63655 100644 --- a/splitkeys.c +++ b/splitkeys.c @@ -5,7 +5,7 @@ * * Copyright 2003 Project Purple * - * $Id: splitkeys.c,v 1.1 2003/09/30 21:16:14 noodles Exp $ + * $Id: splitkeys.c,v 1.3 2003/10/03 23:34:06 noodles Exp $ */ #include @@ -16,7 +16,9 @@ #include "charfuncs.h" #include "keystructs.h" +#include "log.h" #include "mem.h" +#include "onak-conf.h" #include "parsekey.h" int main(int argc, char *argv[]) @@ -36,10 +38,13 @@ int main(int argc, char *argv[]) fprintf(stderr, "Couldn't parse %s as a number of keys!\n", argv[1]); - exit(1); + exit(EXIT_FAILURE); } } + readconfig(); + initlogthing("splitkeys", config.logfile); + do { result = read_openpgp_stream(stdin_getchar, NULL, &packets, maxkeys); @@ -53,6 +58,9 @@ int main(int argc, char *argv[]) tmp->next = NULL; } } + if (tmp->next != NULL) { + list_end = NULL; + } snprintf(splitfile, 1023, "splitfile-%d.pgp", count); outfd = open(splitfile, O_WRONLY | O_CREAT, 0664); @@ -65,5 +73,8 @@ int main(int argc, char *argv[]) } } while (packets != NULL); + cleanuplogthing(); + cleanupconfig(); + return 0; }