Changeset 1036


Ignore:
Timestamp:
11/30/20 03:39:11 (3 years ago)
Author:
Maciej Komosinski
Message:

Fixed comparison for compilers with default char = signed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/util-string.cpp

    r1025 r1036  
    2222        while (*str)
    2323        {
    24                 if (*str >= 32 && *str < 128)
    25                         out += *str;
     24                unsigned char ch = *str;
     25                if (ch >= 32 && ch < 128)
     26                        out += ch;
    2627                else
    2728                {
    28                         if (*str == 10) out += "\\n"; else
    29                                 if (*str == 13) out += "\\r"; else
     29                        if (ch == 10) out += "\\n"; else
     30                                if (ch == 13) out += "\\r"; else
    3031                                {
    31                                         sprintf(hex, "%X", *str);
     32                                        sprintf(hex, "%X", ch);
    3233                                        out += "\\x";
    3334                                        out += hex;
Note: See TracChangeset for help on using the changeset viewer.