From e87e41bb24bbda2e87e6c89d2cc5b9a986ccd346 Mon Sep 17 00:00:00 2001 From: JonathanBeck Date: Wed, 20 Aug 2008 00:46:55 -0700 Subject: arrays of string are now NULL terminated, update for loop end condition. free these arrays when needed. --- src/ifuse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ifuse.c b/src/ifuse.c index 92f5d43..e07c939 100644 --- a/src/ifuse.c +++ b/src/ifuse.c @@ -82,7 +82,7 @@ static int ifuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler, if(!dirs) return -ENOENT; - for (i = 0; strcmp(dirs[i], ""); i++) { + for (i = 0; dirs[i]; i++) { filler(buf, dirs[i], NULL, 0); } @@ -237,7 +237,7 @@ int ifuse_statfs(const char *path, struct statvfs *stats) { if (!info_raw) return -ENOENT; - for (i = 0; strcmp(info_raw[i], ""); i++) { + for (i = 0; info_raw[i]; i++) { if (!strcmp(info_raw[i], "FSTotalBytes")) { totalspace = atoi(info_raw[i+1]); } else if (!strcmp(info_raw[i], "FSFreeBytes")) { @@ -246,6 +246,7 @@ int ifuse_statfs(const char *path, struct statvfs *stats) { blocksize = atoi(info_raw[i+1]); } } + free_dictionary(info_raw); // Now to fill the struct. stats->f_bsize = stats->f_frsize = blocksize; -- cgit v1.1-32-gdbae