X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/394938c479925750ffe56c28d281945ba4003a14..5976b6484c1db0724cf87303c5ddd66e66e725a8:/keydb_fs.c?ds=sidebyside diff --git a/keydb_fs.c b/keydb_fs.c index 08aff83..9575785 100644 --- a/keydb_fs.c +++ b/keydb_fs.c @@ -347,7 +347,9 @@ static struct ll *internal_get_key_by_word(char *word, struct ll *mct) de = readdir(d); if (de && de->d_name[0] != '.') { if ((!mct) - || (llfind(mct, de->d_name, strcmp) != + || (llfind(mct, de->d_name, + (int (*)(const void *, const void *)) + strcmp) != NULL)) { logthing(LOGTHING_CRITICAL, "Found %s // %s", word, @@ -446,14 +448,16 @@ uint64_t getfullkeyid(uint64_t keyid) keydir(buffer, keyid); d = opendir(buffer); - do { - de = readdir(d); - if (de) - if (de && de->d_name[0] != '.') { - ret = strtoull(de->d_name, NULL, 16); - } - } while (de && de->d_name[0] == '.'); - closedir(d); + if (d) { + do { + de = readdir(d); + if (de) + if (de && de->d_name[0] != '.') { + ret = strtoull(de->d_name, NULL, 16); + } + } while (de && de->d_name[0] == '.'); + closedir(d); + } return ret; }