X-Git-Url: http://the.earth.li/gitweb/?a=blobdiff_plain;f=onak.c;h=6baea3debb96715cfd16350480eed24dc57cd119;hb=8d910718e5f13444b2948396564a809b2307f0cf;hp=e4f3105ec9f4fd5e45b740b40f7d20e0e8f9af94;hpb=9bcf53c1662548d457920cd415a2c7266c1128e2;p=onak.git diff --git a/onak.c b/onak.c index e4f3105..6baea3d 100644 --- a/onak.c +++ b/onak.c @@ -68,11 +68,19 @@ void find_keys(char *search, uint64_t keyid, bool ishex, } } +/** + * @brief Context for the keyserver dumping function + */ struct dump_ctx { + /** Keys we've dumped so far to this file */ int count; + /** Maximum keys to dump per file */ int maxcount; + /** File descriptor for the current dump file */ int fd; + /** Number of the current dump file */ int filenum; + /** Base filename to use for dump files */ char *filebase; }; @@ -322,7 +330,8 @@ int main(int argc, char *argv[]) unsigned char *photo = NULL; size_t length = 0; - if (getphoto(keys, 0, &photo, &length)) { + if (getphoto(keys, 0, &photo, + &length) == ONAK_E_OK) { fwrite(photo, 1, length,