Skip to content
Snippets Groups Projects
Commit fdb935f3 authored by David Gobbi's avatar David Gobbi
Browse files

Fix vtkWrapTcl assert on isprint for Visual Studio.

If an out-of-range value is sent to isprint(), then programs generated
by Visual Studio 2010 and later will assert.  I suspect that it does this
because the alternative would be to guess the encoding and potentially
give an incorrect answer, which could compromise the security of the
executable.
parent 751a6512
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,9 @@ static const char *quote_string(const char *comment, size_t maxlen)
strcpy(&result[j],"\\n");
j += 2;
}
else if (isprint(comment[i]))
/* the "0x80" checks for non-ASCII chars, which we do not consider
to be printable since we don't know the encoding */
else if ((comment[i] & 0x80) == 0 && isprint(comment[i]))
{
result[j] = comment[i];
j++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment