From 761dac3d640fd9fc29ccd6dd2397d548e47a6cec Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 23 Oct 2024 10:02:49 +0000 Subject: [PATCH] ftpfs_readdir: specify all parameters to `filler` else they may be filled with garbage instead --- cache.h | 2 -- ftpfs-ls.c | 4 ++-- ftpfs-ls.h | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cache.h b/cache.h index da3879a..94e5dbc 100644 --- a/cache.h +++ b/cache.h @@ -18,8 +18,6 @@ #define CACHE_CLEAN_INTERVAL 60 typedef struct fuse_cache_dirhandle *fuse_cache_dirh_t; -typedef int (*fuse_cache_dirfil_t) (fuse_cache_dirh_t h, const char *name, - const struct stat *stbuf); struct fuse_cache_operations { struct fuse_operations oper; diff --git a/ftpfs-ls.c b/ftpfs-ls.c index 63d6509..eb8a657 100644 --- a/ftpfs-ls.c +++ b/ftpfs-ls.c @@ -190,7 +190,7 @@ static int parse_dir_netware(const char *line, int parse_dir(const char* list, const char* dir, const char* name, struct stat* sbuf, char* linkbuf, int linklen, - void *dbuf, fuse_cache_dirfil_t filler) { + void *dbuf, fuse_fill_dir_t filler) { char *file; char *link; const char *start = list; @@ -255,7 +255,7 @@ int parse_dir(const char* list, const char* dir, if (dbuf && filler) { DEBUG(1, "filler: %s\n", file); - filler(dbuf, file, &stat_buf); + filler(dbuf, file, &stat_buf, 0, 0); } else { DEBUG(1, "cache_add_attr: %s\n", full_path); cache_add_attr(full_path, &stat_buf); diff --git a/ftpfs-ls.h b/ftpfs-ls.h index 17a1456..8988176 100644 --- a/ftpfs-ls.h +++ b/ftpfs-ls.h @@ -9,11 +9,11 @@ See the file COPYING. */ -#include "cache.h" +#include int parse_dir(const char* list, const char* dir, const char* name, struct stat* sbuf, char* linkbuf, int linklen, - void *dbuf, fuse_cache_dirfil_t filler); + void *dbuf, fuse_fill_dir_t filler); #endif /* __CURLFTPFS_FTPFS_LS_H__ */