This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bug in grlib/string.c



There is a bug in the string table processing feature of the graphics library. When a compressed string table is used to get a string, in certain cases where a compressed string composes the first part, and an uncompressed string composes the final part, the length is improperly calculated and a null character is placed after the compressed portion. This is solved by commenting out the if statement on line 2816 like so:

            //
            // If we had not copied any characters before hitting this case,
            // initialize the output pointer (this keeps the code at the end of
            // the function that returns the length happy).  This will be the
            // case if we are using an uncompressed string table.
            //
//            if(!pui8BufferOut)
//            {
                pui8BufferOut = (uint8_t *)pcData + (i32Idx + i32Buf);
//            }

This allows the buffer pointer to be set to the end of the uncompressed portion of the string allowing the length to be computed, and as a result, the null terminating character to be placed at the end of the total concatenated string.