From 56eef2c53a931fdca666ce4d691339394a1293d5 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 1 Sep 2013 11:14:36 +0000 Subject: fixed return code checking logic git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14531 67ed7778-7388-44ab-90cf-0a291f65f57c --- examples/autodetect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/autodetect.c b/examples/autodetect.c index 7772c12fe..fbf6d6fea 100644 --- a/examples/autodetect.c +++ b/examples/autodetect.c @@ -60,7 +60,6 @@ sample_open_camera (Camera ** camera, const char *model, const char *port, GPCon /* Then associate the camera with the specified port */ p = gp_port_info_list_lookup_path (portinfolist, port); - if (ret < GP_OK) return ret; switch (p) { case GP_ERROR_UNKNOWN_PORT: fprintf (stderr, "The port you specified " @@ -74,7 +73,8 @@ sample_open_camera (Camera ** camera, const char *model, const char *port, GPCon default: break; } - if (ret < GP_OK) return ret; + if (p < GP_OK) return p; + ret = gp_port_info_list_get_info (portinfolist, p, &pi); if (ret < GP_OK) return ret; ret = gp_camera_set_port_info (*camera, pi); -- cgit v1.2.1