From 6b1a5c33af384d5e42175dae19bb46ae48a0c717 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 5 Aug 2008 20:34:34 +0000 Subject: [PATCH] * Fix probable cause of one of the bugs seen in the osgrid office hours today * If a text string is too long we actually need to truncate to 254 chars rather than 255, since the Helpers.StringToField conversion will stick a \0 on the end --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 4e9b1aecd8..93cb8900a9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -2287,10 +2287,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP outPacket.ObjectData[0].FullID = objectID; outPacket.ObjectData[0].OwnerID = ownerID; - // Anything more than 255 will cause libsecondlife to barf - if (text.Length > 255) + // Anything more than 254 will cause libsecondlife to barf + // (libsl 1550) adds an \0 on the Helpers.StringToField conversion if it isn't present + if (text.Length > 254) { - text = text.Remove(255); + text = text.Remove(254); } outPacket.ObjectData[0].Text = Helpers.StringToField(text);