summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2007-05-11 17:21:01 +0000
committerMarcus Meissner <marcus@jet.franken.de>2007-05-11 17:21:01 +0000
commit50383937c5a36717b4b39b2295c9a37692a6f392 (patch)
tree014b3050afd450a3999ff6053dfdf62feceb41f7
parent44809178358eb83cf58f11953ef3e460b1e21980 (diff)
downloadlibgphoto2-50383937c5a36717b4b39b2295c9a37692a6f392.tar.gz
removed incorrect memset, replaced with calloc.
fixed missing return check (CID 20) git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10184 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r--camlibs/sonix/library.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/camlibs/sonix/library.c b/camlibs/sonix/library.c
index 15dca5791..e2a34bace 100644
--- a/camlibs/sonix/library.c
+++ b/camlibs/sonix/library.c
@@ -218,6 +218,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename,
/* Get the number of the photo on the camera */
k = gp_filesystem_number (camera->fs, "/", filename, context);
+ if (k < GP_OK) return k;
if(type == GP_FILE_TYPE_EXIF) return GP_ERROR_FILE_EXISTS;
@@ -243,9 +244,8 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename,
buffersize = rawsize - (rawsize%0x40) + 0x40;
else
buffersize = rawsize;
- data = malloc (buffersize+64);
+ data = calloc (buffersize+64, 1);
if (!data) return GP_ERROR_NO_MEMORY;
- memset (data, 0, sizeof(data));
gp_port_read(camera->port, data, buffersize);
switch(type) {