X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/0a3cfdec02106998006653f8ad340e996261a3d5..5976b6484c1db0724cf87303c5ddd66e66e725a8:/keydb_fs.c diff --git a/keydb_fs.c b/keydb_fs.c index 7de5bac..9575785 100644 --- a/keydb_fs.c +++ b/keydb_fs.c @@ -4,8 +4,6 @@ * Daniel Silverstone * * Copyright 2004 Daniel Silverstone and Project Purple - * - * $Id: keydb_fs.c,v 1.3 2004/05/28 03:23:04 noodles Exp $ */ #include @@ -349,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, @@ -448,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; }