projects
/
onak.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove unused variables
[onak.git]
/
onak.c
diff --git
a/onak.c
b/onak.c
index 3a6f62fad122af9e8103ce87eaab04d60c4610b1..e6b92871ae57a1a4898712a80c06ef07bc869a00 100644
(file)
--- a/
onak.c
+++ b/
onak.c
@@
-74,7
+74,7
@@
void dump_func(void *ctx, struct openpgp_publickey *key)
state = (struct dump_ctx *) ctx;
state = (struct dump_ctx *) ctx;
- if (state->fd == -1 || state->count > state->maxcount) {
+ if (state->fd == -1 || state->count
++
> state->maxcount) {
if (state->fd != -1) {
close(state->fd);
state->fd = -1;
if (state->fd != -1) {
close(state->fd);
state->fd = -1;
@@
-161,7
+161,7
@@
int main(int argc, char *argv[])
} else if (!strcmp("dump", argv[optind])) {
config.dbbackend->initdb(true);
dumpstate.count = dumpstate.filenum = 0;
} else if (!strcmp("dump", argv[optind])) {
config.dbbackend->initdb(true);
dumpstate.count = dumpstate.filenum = 0;
- dumpstate.maxcount = 100000
0
;
+ dumpstate.maxcount = 100000;
dumpstate.fd = -1;
dumpstate.filebase = "keydump.%d.pgp";
config.dbbackend->iterate_keys(dump_func, &dumpstate);
dumpstate.fd = -1;
dumpstate.filebase = "keydump.%d.pgp";
config.dbbackend->iterate_keys(dump_func, &dumpstate);
@@
-322,9
+322,15
@@
int main(int argc, char *argv[])
&packets,
&list_end);
free_publickey(keys);
&packets,
&list_end);
free_publickey(keys);
- armor_openpgp_stream(stdout_putchar,
+ if (binary) {
+ write_openpgp_stream(stdout_putchar,
NULL,
packets);
NULL,
packets);
+ } else {
+ armor_openpgp_stream(stdout_putchar,
+ NULL,
+ packets);
+ }
free_packet_list(packets);
packets = NULL;
} else {
free_packet_list(packets);
packets = NULL;
} else {