Fix a Clang warning, checking signed char as if it was unsigned.
This commit is contained in:
parent
0f61108f5b
commit
33dd4b3b92
1 changed files with 5 additions and 3 deletions
|
@ -658,13 +658,15 @@ string FGAV400WSimB::asciitize_message( string message ) {
|
||||||
string asciimsg;
|
string asciimsg;
|
||||||
|
|
||||||
for ( string::const_iterator cli = message.begin();
|
for ( string::const_iterator cli = message.begin();
|
||||||
cli != message.end(); cli++ ) {
|
cli != message.end(); cli++ )
|
||||||
if ( *cli >= 32 && *cli <= 127 ) {
|
{
|
||||||
|
unsigned char uc = static_cast<unsigned char>(*cli);
|
||||||
|
if ( uc >= 32 && uc <= 127 ) {
|
||||||
asciimsg += *cli;
|
asciimsg += *cli;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char tempbuf[20];
|
char tempbuf[20];
|
||||||
sprintf( tempbuf, "\\x%02X", (unsigned char)(*cli) );
|
sprintf( tempbuf, "\\x%02X", uc );
|
||||||
asciimsg += tempbuf;
|
asciimsg += tempbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue