Corrected a minor issue in the bacapp.c file on the PC side when printing strings with garbage characters with the 8th bit set. The code passed a signed char to the isprint() function which gets sign extended to an int and then caused an assert in the Microsoft library code (Visual C++ Express 2008). Thank you, Peter!
This commit is contained in:
@@ -744,10 +744,11 @@ bool bacapp_print_value(
|
||||
characterstring_value(&value->type.Character_String);
|
||||
fprintf(stream, "\"");
|
||||
for (i = 0; i < len; i++) {
|
||||
if (isprint(*char_str))
|
||||
if (isprint(*((unsigned char *)char_str))) {
|
||||
fprintf(stream, "%c", *char_str);
|
||||
else
|
||||
} else {
|
||||
fprintf(stream, ".");
|
||||
}
|
||||
char_str++;
|
||||
}
|
||||
fprintf(stream, "\"");
|
||||
|
||||
Reference in New Issue
Block a user