From: Andrew Aitchison Date: Wed, 4 Sep 2024 20:37:57 +0000 (+0100) Subject: Debug: fix coding for signedness X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/e89891fa5e27a1a6f895f45d324f2b407c41539b?hp=2d75f09c2df079365b0fc2c9fb22a130c9267611 Debug: fix coding for signedness Broken-by: 2d75f09c2df0 --- diff --git a/src/src/string.c b/src/src/string.c index f652b3815..2b62233d8 100644 --- a/src/src/string.c +++ b/src/src/string.c @@ -1687,11 +1687,14 @@ while (*fp) case '{' : zg = string_catn(zg, US"{BO}", 4); break; case '}' : zg = string_catn(zg, US"{BC}", 4); break; default: - if ( (*s < 32) || (*s > 127) ) - zg = string_fmt_append(zg, "{%02x}", *s); + { + unsigned char u = *s; + if ( (u < 32) || (u > 127) ) + zg = string_fmt_append(zg, "{%02x}", u); else zg = string_catn(zg, US s, 1); break; + } } if (zg) { s = CS zg->s; precision = slen = gstring_length(zg); } else { s = ""; slen = 0; }