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;
} else if (!strcmp("dump", argv[optind])) {
config.dbbackend->initdb(true);
dumpstate.count = dumpstate.filenum = 0;
- dumpstate.maxcount = 1000000;
+ dumpstate.maxcount = 100000;
dumpstate.fd = -1;
dumpstate.filebase = "keydump.%d.pgp";
config.dbbackend->iterate_keys(dump_func, &dumpstate);
&packets,
&list_end);
free_publickey(keys);
- armor_openpgp_stream(stdout_putchar,
+ if (binary) {
+ write_openpgp_stream(stdout_putchar,
NULL,
packets);
+ } else {
+ armor_openpgp_stream(stdout_putchar,
+ NULL,
+ packets);
+ }
free_packet_list(packets);
packets = NULL;
} else {