Added handling of the case when length is -1, allowing the code to just test

against characters being zero, rather than against length, which is now only
done when a valid value of length (i.e >=0) is passed in.
This commit is contained in:
Robert Osfield
2003-01-13 14:56:04 +00:00
parent 7ee6d4f3f4
commit c3c346e647

View File

@@ -213,7 +213,7 @@ void EncodedText::setText(const unsigned char* text, int length)
int character = getNextCharacter(text);
int charCount = (int)(text-textStart);
while ((character) && (charCount <= length))
while ((character) && (length<0 || (charCount <= length)))
{
_unicodeText.push_back(character);
character = getNextCharacter(text);