From: James Turner Date: Sat, 12 May 2012 09:26:15 +0000 (+0100) Subject: Fix a Clang warning, checking signed char as if it was unsigned. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=33dd4b3b92eb44bc179ff0c75b3e36576c1c0a03;p=flightgear.git Fix a Clang warning, checking signed char as if it was unsigned. --- diff --git a/src/Network/AV400WSim.cxx b/src/Network/AV400WSim.cxx index 83037dd46..6dd5033d8 100644 --- a/src/Network/AV400WSim.cxx +++ b/src/Network/AV400WSim.cxx @@ -658,13 +658,15 @@ string FGAV400WSimB::asciitize_message( string message ) { string asciimsg; for ( string::const_iterator cli = message.begin(); - cli != message.end(); cli++ ) { - if ( *cli >= 32 && *cli <= 127 ) { + cli != message.end(); cli++ ) + { + unsigned char uc = static_cast(*cli); + if ( uc >= 32 && uc <= 127 ) { asciimsg += *cli; } else { char tempbuf[20]; - sprintf( tempbuf, "\\x%02X", (unsigned char)(*cli) ); + sprintf( tempbuf, "\\x%02X", uc ); asciimsg += tempbuf; } }