1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

Avoid assert on passing negative values to isprint (due to type promotion)

This commit is contained in:
Mike Gelfand 2015-06-26 21:22:27 +00:00
parent 2b5a03a88c
commit ba7ea94c7d

View 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);