diff options
author | Martin Peach <mrpeach@users.sourceforge.net> | 2012-03-20 20:26:13 +0000 |
---|---|---|
committer | Martin Peach <mrpeach@users.sourceforge.net> | 2012-03-20 20:26:13 +0000 |
commit | 340202698cca0aa80767771a3e2cb97224bff943 (patch) | |
tree | 98706bc8d7850e99f1b5b75ecea7669a37b3f66c | |
parent | 26793de13de4716b8e387fae5fa28c6262a5a841 (diff) |
Attempt to allow UTF-8 text in strings by only rejecting characters less than space (0x20).
svn path=/trunk/externals/mrpeach/; revision=16082
-rw-r--r-- | osc/unpackOSC.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/osc/unpackOSC.c b/osc/unpackOSC.c index cc29265..45405a7 100644 --- a/osc/unpackOSC.c +++ b/osc/unpackOSC.c @@ -579,9 +579,10 @@ static int unpackOSC_IsNiceString(char *string, char *boundary) return 0; } + /* anything less than space (0x20) is no good, UTF-8 sequences will be accepted -- not strictly OSC v1.0 */ for (i = 0; string[i] != '\0'; i++) - if ((!isprint(string[i])) || (string + i >= boundary)) return 0; - + /* if ((!isprint(string[i])) || (string + i >= boundary)) return 0; */ /* only ASCII printable chars */ + if ((0==(string[i]&0xE0)) || (string + i >= boundary)) return 0; /* If we made it this far, it's a null-terminated sequence of printing characters in the given boundary. Now we just make sure it's null padded... */ |