2001-08-19 Lutz M�ller <urc8@rz.uni-karlsruhe.de>

* libgphoto2/filesys.c (gp_filesystem_format): Fix bug found by
        St�phane Castejon.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2012 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Lutz Mueller
2001-08-19 12:19:57 +00:00
parent 373ca0e737
commit 3c0d56d0bd
2 changed files with 15 additions and 9 deletions

View File

@@ -1,3 +1,8 @@
2001-08-19 Lutz Müller <urc8@rz.uni-karlsruhe.de>
* libgphoto2/filesys.c (gp_filesystem_format): Fix bug found by
Stéphane Castejon.
2001-08-19 Lutz Müller <urc8@rz.uni-karlsruhe.de>
* libgphoto2/globals.h: Unused. Removed.

View File

@@ -330,15 +330,16 @@ gp_filesystem_format (CameraFilesystem *fs)
{
int x, y;
if (fs->folder) {
for (x = 0; x < fs->count; x++) {
for (y=0; y<fs->folder[x]->count; y++)
free (fs->folder[x]->file[y]);
free (fs->folder[x]);
}
free (fs->folder);
}
fs->count = 0;
if (!fs)
return (GP_ERROR_BAD_PARAMETERS);
for (x = 0; x < fs->count; x++) {
for (y = 0; y < fs->folder[x]->count; y++)
free (fs->folder[x]->file[y]);
free (fs->folder[x]);
}
free (fs->folder);
fs->count = 0;
return (GP_OK);
}