summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar JonathanBeck2008-08-20 00:46:55 -0700
committerGravatar Jonathan Beck2008-08-21 19:15:38 +0200
commite87e41bb24bbda2e87e6c89d2cc5b9a986ccd346 (patch)
tree471b275bd61e9b28fb3f50e3da884b7dfc7164c5
parentefe860d7c66c18ce9c53ecf36e2b24af1f501e74 (diff)
downloadlibimobiledevice-e87e41bb24bbda2e87e6c89d2cc5b9a986ccd346.tar.gz
libimobiledevice-e87e41bb24bbda2e87e6c89d2cc5b9a986ccd346.tar.bz2
arrays of string are now NULL terminated, update for loop end condition.
free these arrays when needed.
-rw-r--r--src/ifuse.c5
1 files changed, 3 insertions, 2 deletions
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,
82 if(!dirs) 82 if(!dirs)
83 return -ENOENT; 83 return -ENOENT;
84 84
85 for (i = 0; strcmp(dirs[i], ""); i++) { 85 for (i = 0; dirs[i]; i++) {
86 filler(buf, dirs[i], NULL, 0); 86 filler(buf, dirs[i], NULL, 0);
87 } 87 }
88 88
@@ -237,7 +237,7 @@ int ifuse_statfs(const char *path, struct statvfs *stats) {
237 237
238 if (!info_raw) return -ENOENT; 238 if (!info_raw) return -ENOENT;
239 239
240 for (i = 0; strcmp(info_raw[i], ""); i++) { 240 for (i = 0; info_raw[i]; i++) {
241 if (!strcmp(info_raw[i], "FSTotalBytes")) { 241 if (!strcmp(info_raw[i], "FSTotalBytes")) {
242 totalspace = atoi(info_raw[i+1]); 242 totalspace = atoi(info_raw[i+1]);
243 } else if (!strcmp(info_raw[i], "FSFreeBytes")) { 243 } else if (!strcmp(info_raw[i], "FSFreeBytes")) {
@@ -246,6 +246,7 @@ int ifuse_statfs(const char *path, struct statvfs *stats) {
246 blocksize = atoi(info_raw[i+1]); 246 blocksize = atoi(info_raw[i+1]);
247 } 247 }
248 } 248 }
249 free_dictionary(info_raw);
249 250
250 // Now to fill the struct. 251 // Now to fill the struct.
251 stats->f_bsize = stats->f_frsize = blocksize; 252 stats->f_bsize = stats->f_frsize = blocksize;