about summary refs log tree commit diff
path: root/src/libnsss/nsss_switch_pwd_getbyname.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-09-02 16:46:41 +0000
committerLaurent Bercot <ska@appnovation.com>2021-09-02 16:46:41 +0000
commit1f213b642deb1d8e6139d2b7daac8f639c8717e7 (patch)
tree09c938120a9be6a97ec6c52b082316d7a3143db9 /src/libnsss/nsss_switch_pwd_getbyname.c
parentc9a58ceb7c07774944930105ace2f042be7b5f53 (diff)
downloadnsss-1f213b642deb1d8e6139d2b7daac8f639c8717e7.tar.gz
nsss-1f213b642deb1d8e6139d2b7daac8f639c8717e7.tar.xz
nsss-1f213b642deb1d8e6139d2b7daac8f639c8717e7.zip
Pass errno as unsigned char
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libnsss/nsss_switch_pwd_getbyname.c')
-rw-r--r--src/libnsss/nsss_switch_pwd_getbyname.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libnsss/nsss_switch_pwd_getbyname.c b/src/libnsss/nsss_switch_pwd_getbyname.c
index 9b3d164..eea9923 100644
--- a/src/libnsss/nsss_switch_pwd_getbyname.c
+++ b/src/libnsss/nsss_switch_pwd_getbyname.c
@@ -19,6 +19,6 @@ int nsss_switch_pwd_getbyname (nsss_switch_t *a, struct passwd *pw, stralloc *sa
   if (!ipc_timed_sendv(buffer_fd(&a->b), v, 2, deadline, stamp)) return 0 ;
   if (!buffer_timed_get(&a->b, &buf[0], 1, deadline, stamp)) return 0 ;
   if ((unsigned char)buf[0] == 255) return 0 ;
-  if (buf[0]) return (errno = buf[0], 0) ;
+  if (buf[0]) return (errno = (unsigned char)buf[0], 0) ;
   return nsss_switch_pwd_read(&a->b, pw, sa, deadline, stamp) ;
 }