]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a Clang warning, checking signed char as if it was unsigned.
authorJames Turner <zakalawe@mac.com>
Sat, 12 May 2012 09:26:15 +0000 (10:26 +0100)
committerJames Turner <zakalawe@mac.com>
Sat, 12 May 2012 09:26:15 +0000 (10:26 +0100)
src/Network/AV400WSim.cxx

index 83037dd468e6f8be91b2ac3c03f05b0622e4c06a..6dd5033d8c6df2d2d8dd0d5b3ee4cf77a9b7890e 100644 (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;
         }
     }