diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Util.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index af14939..ed24452 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -2221,9 +2221,9 @@ namespace OpenSim.Framework | |||
2221 | // might have gotten an oversized array even after the string trim | 2221 | // might have gotten an oversized array even after the string trim |
2222 | byte[] data = UTF8.GetBytes(str); | 2222 | byte[] data = UTF8.GetBytes(str); |
2223 | 2223 | ||
2224 | if (data.Length > 256) | 2224 | if (data.Length > 255) //play safe |
2225 | { | 2225 | { |
2226 | int cut = 255; | 2226 | int cut = 254; |
2227 | if((data[cut] & 0x80 ) != 0 ) | 2227 | if((data[cut] & 0x80 ) != 0 ) |
2228 | { | 2228 | { |
2229 | while(cut > 0 && (data[cut] & 0xc0) != 0xc0) | 2229 | while(cut > 0 && (data[cut] & 0xc0) != 0xc0) |
@@ -2325,7 +2325,7 @@ namespace OpenSim.Framework | |||
2325 | 2325 | ||
2326 | if (data.Length > MaxLength) | 2326 | if (data.Length > MaxLength) |
2327 | { | 2327 | { |
2328 | int cut = MaxLength -1 ; | 2328 | int cut = MaxLength - 1 ; |
2329 | if((data[cut] & 0x80 ) != 0 ) | 2329 | if((data[cut] & 0x80 ) != 0 ) |
2330 | { | 2330 | { |
2331 | while(cut > 0 && (data[cut] & 0xc0) != 0xc0) | 2331 | while(cut > 0 && (data[cut] & 0xc0) != 0xc0) |