Commit e87e41bb authored by JonathanBeck's avatar JonathanBeck Committed by Jonathan Beck

arrays of string are now NULL terminated, update for loop end condition.

free these arrays when needed.
parent efe860d7
...@@ -82,7 +82,7 @@ static int ifuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler, ...@@ -82,7 +82,7 @@ static int ifuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
if(!dirs) if(!dirs)
return -ENOENT; return -ENOENT;
for (i = 0; strcmp(dirs[i], ""); i++) { for (i = 0; dirs[i]; i++) {
filler(buf, dirs[i], NULL, 0); filler(buf, dirs[i], NULL, 0);
} }
...@@ -237,7 +237,7 @@ int ifuse_statfs(const char *path, struct statvfs *stats) { ...@@ -237,7 +237,7 @@ int ifuse_statfs(const char *path, struct statvfs *stats) {
if (!info_raw) return -ENOENT; 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")) { if (!strcmp(info_raw[i], "FSTotalBytes")) {
totalspace = atoi(info_raw[i+1]); totalspace = atoi(info_raw[i+1]);
} else if (!strcmp(info_raw[i], "FSFreeBytes")) { } else if (!strcmp(info_raw[i], "FSFreeBytes")) {
...@@ -246,6 +246,7 @@ int ifuse_statfs(const char *path, struct statvfs *stats) { ...@@ -246,6 +246,7 @@ int ifuse_statfs(const char *path, struct statvfs *stats) {
blocksize = atoi(info_raw[i+1]); blocksize = atoi(info_raw[i+1]);
} }
} }
free_dictionary(info_raw);
// Now to fill the struct. // Now to fill the struct.
stats->f_bsize = stats->f_frsize = blocksize; stats->f_bsize = stats->f_frsize = blocksize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment