From 1f213b642deb1d8e6139d2b7daac8f639c8717e7 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 2 Sep 2021 16:46:41 +0000 Subject: Pass errno as unsigned char Signed-off-by: Laurent Bercot --- src/libnsss/nsss_switch_pwd_get.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libnsss/nsss_switch_pwd_get.c') diff --git a/src/libnsss/nsss_switch_pwd_get.c b/src/libnsss/nsss_switch_pwd_get.c index 6b9c310..146e934 100644 --- a/src/libnsss/nsss_switch_pwd_get.c +++ b/src/libnsss/nsss_switch_pwd_get.c @@ -8,10 +8,10 @@ int nsss_switch_pwd_get (nsss_switch_t *a, struct passwd *pw, stralloc *sa, tain const *deadline, tain *stamp) { - char c = NSSS_SWITCH_PWD_GET ; - if (!ipc_timed_send(buffer_fd(&a->b), &c, 1, deadline, stamp)) return 0 ; - if (!buffer_timed_get(&a->b, &c, 1, deadline, stamp)) return 0 ; - if ((unsigned char)c == 255) return 0 ; + unsigned char c = NSSS_SWITCH_PWD_GET ; + if (!ipc_timed_send(buffer_fd(&a->b), (char *)&c, 1, deadline, stamp)) return 0 ; + if (!buffer_timed_get(&a->b, (char *)&c, 1, deadline, stamp)) return 0 ; + if (c == 255) return 0 ; if (c) return (errno = c, 0) ; return nsss_switch_pwd_read(&a->b, pw, sa, deadline, stamp) ; } -- cgit 1.4.1