From 2078941b3737d7a1d8b2d84a9771c18d33aa2925 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 4 May 2016 13:48:50 +0200 Subject: fix error condition for yk_get_serial() --- bin/ykfde.c | 3 ++- udev/ykfde.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/ykfde.c b/bin/ykfde.c index 1277e2c..bfdfa6b 100644 --- a/bin/ykfde.c +++ b/bin/ykfde.c @@ -158,8 +158,9 @@ int main(int argc, char **argv) { } /* read the serial number from key */ - if ((rc = yk_get_serial(yk, 0, 0, &serial)) < 0) { + if (yk_get_serial(yk, 0, 0, &serial) == 0) { perror("yk_get_serial() failed"); + rc = EXIT_FAILURE; goto out40; } diff --git a/udev/ykfde.c b/udev/ykfde.c index 43b25e4..3d303e6 100644 --- a/udev/ykfde.c +++ b/udev/ykfde.c @@ -243,8 +243,9 @@ int main(int argc, char **argv) { } /* read the serial number from key */ - if ((rc = yk_get_serial(yk, 0, 0, &serial)) < 0) { + if (yk_get_serial(yk, 0, 0, &serial) == 0) { perror("yk_get_serial() failed"); + rc = EXIT_FAILURE; goto out30; } -- cgit v1.2.3-70-g09d2