* Daniel Silverstone <dsilvers@digital-scurf.org>
*
* Copyright 2004 Daniel Silverstone and Project Purple
- *
- * $Id: keydb_fs.c,v 1.3 2004/05/28 03:23:04 noodles Exp $
*/
#include <sys/types.h>
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,
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;
}