about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-09-02 17:14:51 +0000
committerLaurent Bercot <ska@appnovation.com>2021-09-02 17:14:51 +0000
commitc2d4dfaa55d336c982b71d79411386ca4da126d1 (patch)
treefc3d8a72efbe377e2577407d0270fb471205f6fb
parent39b0b146fe446fa6db80f4ca7661a284f38638fc (diff)
downloadpamela-c2d4dfaa55d336c982b71d79411386ca4da126d1.tar.gz
pamela-c2d4dfaa55d336c982b71d79411386ca4da126d1.tar.xz
pamela-c2d4dfaa55d336c982b71d79411386ca4da126d1.zip
Pass errno as unsigned char
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--src/pamela/pamela_query_string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pamela/pamela_query_string.c b/src/pamela/pamela_query_string.c
index 27c131f..978940d 100644
--- a/src/pamela/pamela_query_string.c
+++ b/src/pamela/pamela_query_string.c
@@ -14,7 +14,7 @@ int pamela_query_string (pamela_t *a, char const *s, size_t len, stralloc *sa)
   if (textmessage_timed_receive(&a->in, &v, 0, 0) <= 0) return 0 ;
   if (!v.iov_len) return (errno = EPROTO, 0) ;
   s = v.iov_base ;
-  if (s[0]) return (errno = s[0], 0) ;
+  if (s[0]) return (errno = (unsigned char)s[0], 0) ;
   if (!stralloc_catb(sa, s + 1, v.iov_len - 1)) return 0 ;
   return 1 ;
 }