1
0
Fork 0

Fix a Clang warning, checking signed char as if it was unsigned.

This commit is contained in:
James Turner 2012-05-12 10:26:15 +01:00
parent 0f61108f5b
commit 33dd4b3b92

View file

@ -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<unsigned char>(*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;
}
}