X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/4843e5290f2e7060ca5777c64b96e680080644f2..59e5def499b3e9ae3587ebae2bef8794a1df34ea:/splitkeys.c?ds=inline diff --git a/splitkeys.c b/splitkeys.c index a2daac6..73a94cd 100644 --- a/splitkeys.c +++ b/splitkeys.c @@ -4,8 +4,6 @@ * Jonathan McDowell * * Copyright 2003 Project Purple - * - * $Id: splitkeys.c,v 1.1 2003/09/30 21:16:14 noodles Exp $ */ #include @@ -16,7 +14,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 +36,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(NULL); + initlogthing("splitkeys", config.logfile); + do { result = read_openpgp_stream(stdin_getchar, NULL, &packets, maxkeys); @@ -53,6 +56,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 +71,8 @@ int main(int argc, char *argv[]) } } while (packets != NULL); + cleanuplogthing(); + cleanupconfig(); + return 0; }