Start pulling non-library material out of core source files
[onak.git] / keydb_file.c
index e1d0b528bc1f06eb08e3fdd473830603d82c1bcf..65e71f559d409b28bb7a9d341f398412788f6eef 100644 (file)
@@ -128,9 +128,11 @@ static int file_store_key(struct openpgp_publickey *publickey, bool intrans,
        struct openpgp_publickey *next = NULL;
        char keyfile[1024];
        int fd = -1;
+       uint64_t keyid;
 
+       get_keyid(publickey, &keyid);
        snprintf(keyfile, 1023, "%s/0x%" PRIX64, config.db_dir,
-                       get_keyid(publickey) & 0xFFFFFFFF);
+                       keyid & 0xFFFFFFFF);
        fd = open(keyfile, O_WRONLY | O_CREAT, 0664); // | O_EXLOCK);
 
        if (fd > -1) {