diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2007-05-11 17:18:05 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2007-05-11 17:18:05 +0000 |
commit | 44809178358eb83cf58f11953ef3e460b1e21980 (patch) | |
tree | 4eb590d8ec3b99b319b403e3acc483f718b2f005 | |
parent | 47441c9a794409e97dc03dd5beb7130282da3611 (diff) | |
download | libgphoto2-44809178358eb83cf58f11953ef3e460b1e21980.tar.gz |
added some missing error checks (CID 20) (CID 21)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10183 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r-- | camlibs/sonydscf1/sonydscf1.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/camlibs/sonydscf1/sonydscf1.c b/camlibs/sonydscf1/sonydscf1.c index 9aff606c3..4e876730f 100644 --- a/camlibs/sonydscf1/sonydscf1.c +++ b/camlibs/sonydscf1/sonydscf1.c @@ -77,6 +77,8 @@ static int get_file_func (CameraFilesystem *fs, const char *folder, /* Retrieve the number of the photo on the camera */ num = gp_filesystem_number(camera->fs, "/", filename, context); + if (num < GP_OK) + return num; switch (type) { case GP_FILE_TYPE_NORMAL: @@ -103,8 +105,12 @@ static int delete_file_func (CameraFilesystem *fs, const char *folder, int max, num; num = gp_filesystem_number(camera->fs, "/", filename, context); + if (num<GP_OK) + return num; max = gp_filesystem_count(camera->fs,folder, context); - printf("sony dscf1: file delete: %d\n",num); + if (max<GP_OK) + return max; + gp_log (GP_LOG_DEBUG, "sonydscf1", "file delete: %d",num); if(!F1ok(camera->port)) return (GP_ERROR); delete_picture(camera->port,num,max); |