tools: pass -rc to strerror, not rc
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 22 Aug 2014 01:45:01 +0000 (11:45 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 22 Aug 2014 01:50:15 +0000 (11:50 +1000)
rc is a negative errno

Found by Coverity.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools/libevdev-events.c

index 0711c78..3ce23f1 100644 (file)
@@ -185,7 +185,7 @@ main(int argc, char **argv)
        } while (rc == LIBEVDEV_READ_STATUS_SYNC || rc == LIBEVDEV_READ_STATUS_SUCCESS || rc == -EAGAIN);
 
        if (rc != LIBEVDEV_READ_STATUS_SUCCESS && rc != -EAGAIN)
-               fprintf(stderr, "Failed to handle events: %s\n", strerror(rc));
+               fprintf(stderr, "Failed to handle events: %s\n", strerror(-rc));
 
        rc = 0;
 out: