Skip to content

Commit

Permalink
Added check for zero handle in pedalog_read_data
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Haughey committed Sep 6, 2011
1 parent 01e3ffd commit 1db82d0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pedalog.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,19 @@ int pedalog_read_data(pedalog_device *device, pedalog_data *data)
#endif

handle = usb_open(pedalog);

#ifdef DEBUG
printf(" usb_open returned handle '%x'\n", handle);
#endif

if (handle == 0)
{
#ifdef DEBUG
printf("Exiting pedalog_read_data, returning PEDALOG_ERROR_NO_DEVICE_FOUND\n");
#endif
return PEDALOG_ERROR_NO_DEVICE_FOUND;
}

#ifdef DEBUG
printf(" Calling read_data_internal...\n");
#endif

Expand Down

0 comments on commit 1db82d0

Please sign in to comment.