]> granicus.if.org Git - transmission/commitdiff
Avoid assert on passing negative values to `isprint` (due to type promotion)
authorMike Gelfand <mikedld@mikedld.com>
Fri, 26 Jun 2015 21:22:27 +0000 (21:22 +0000)
committerMike Gelfand <mikedld@mikedld.com>
Fri, 26 Jun 2015 21:22:27 +0000 (21:22 +0000)
libtransmission/clients.c

index defc49f80015b81befe7021393184d8fa8864e4e..6a4d49143329e14ff5c4362a9fd05262c0c9e0b9 100644 (file)
@@ -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);