From ba7ea94c7d737ed92856cb605996b751c3eedac0 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Fri, 26 Jun 2015 21:22:27 +0000 Subject: [PATCH] Avoid assert on passing negative values to `isprint` (due to type promotion) --- libtransmission/clients.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtransmission/clients.c b/libtransmission/clients.c index defc49f80..6a4d49143 100644 --- a/libtransmission/clients.c +++ b/libtransmission/clients.c @@ -457,7 +457,7 @@ tr_clientForId (char * buf, size_t buflen, const void * id_in) char out[32], *walk=out; const char *in, *in_end; for (in= (const char*)id, in_end=in+8; in!=in_end; ++in) { - if (isprint (*in)) + if (isprint ((unsigned char) *in)) *walk++ = *in; else { tr_snprintf (walk, out+sizeof (out)-walk, "%%%02X", (unsigned int)*in); -- 2.40.0