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:
skarg
2009-06-17 23:22:48 +00:00
parent 95b94f75fd
commit 8dc12fcd98
+3 -2
View File
@@ -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, "\"");