fix deadcode and leak. (CID 4) (CID 53)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10142 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
@@ -666,7 +666,7 @@ int dc3200_recv_packet(Camera *camera, unsigned char *data, int *data_len)
|
||||
|
||||
res = gp_port_read(camera->port, &buff[num_read], 1);
|
||||
|
||||
while(res > 0 && fails < READ_RETRIES) {
|
||||
while(res >= 0 && fails < READ_RETRIES) {
|
||||
if(res == 0) {
|
||||
/* read nothing */
|
||||
fails++;
|
||||
@@ -846,6 +846,7 @@ int dc3200_process_packet(Camera *camera, unsigned char *data, int *data_len)
|
||||
/* make sure its a valid packet */
|
||||
if(length != count - 3 || checksum != dc3200_calc_checksum(camera, data, count - 2)) {
|
||||
printf("%02x=%02x %02x=%02x\n", length, count - 3, checksum, dc3200_calc_checksum(camera, data, count - 2));
|
||||
free(buff);
|
||||
return GP_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user