From c3c346e64783e85b2500c2879f682916a7117fe5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 13 Jan 2003 14:56:04 +0000 Subject: [PATCH] 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. --- src/osgText/EncodedText.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgText/EncodedText.cpp b/src/osgText/EncodedText.cpp index 01b5fbdd4..c867de64e 100644 --- a/src/osgText/EncodedText.cpp +++ b/src/osgText/EncodedText.cpp @@ -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);