From db52afe7db2c9560798df088bb484cd5f2d89ee7 Mon Sep 17 00:00:00 2001 From: Fredrik Date: Mon, 3 Dec 2001 12:33:07 +0000 Subject: [PATCH] Some obvious fixes to canon_serial_get_dirents(). Must have missed those when I implemented the code a few days ago. Sorry about that. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3367 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/canon/serial.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/camlibs/canon/serial.c b/camlibs/canon/serial.c index bd7ab11c4..a5cffd7c4 100644 --- a/camlibs/canon/serial.c +++ b/camlibs/canon/serial.c @@ -1025,7 +1025,7 @@ canon_serial_get_dirents (Camera *camera, unsigned char **dirent_data, gp_camera_set_error (camera, "canon_serial_get_dirents: " "Initial dirent packet too short (only %i bytes)", *dirents_length); - return NULL; + return GP_ERROR; } /* don't use GP_DEBUG since we log this with GP_LOG_DATA */ @@ -1057,12 +1057,12 @@ canon_serial_get_dirents (Camera *camera, unsigned char **dirent_data, */ while (!p[4]) { GP_DEBUG ("p[4] is %i", (int) p[4]); - p = canon_serial_recv_msg (camera, 0xb, 0x21, *dirents_length); + p = canon_serial_recv_msg (camera, 0xb, 0x21, dirents_length); if (p == NULL) { gp_camera_set_error (camera, "canon_serial_get_dirents: " "Failed to read another directory entry"); free (data); - return NULL; + return GP_ERROR; } /* don't use GP_DEBUG since we log this with GP_LOG_DATA */ @@ -1077,7 +1077,7 @@ canon_serial_get_dirents (Camera *camera, unsigned char **dirent_data, gp_camera_set_error (camera, "canon_serial_get_dirents: " "Truncated directory entry received"); free (data); - return NULL; + return GP_ERROR; } /* check if we need to allocate some more memory, @@ -1102,7 +1102,7 @@ canon_serial_get_dirents (Camera *camera, unsigned char **dirent_data, gp_camera_set_error (camera, "canon_serial_get_dirents: " "Too many dirents, we must be looping."); free (data); - return NULL; + return GP_ERROR; } temp_ch = realloc (data, mallocd_bytes); @@ -1112,7 +1112,7 @@ canon_serial_get_dirents (Camera *camera, unsigned char **dirent_data, "Could not resize dirent buffer " "to %i bytes", mallocd_bytes); free (data); - return NULL; + return GP_ERROR; } data = temp_ch; }