On 20/03/2026 10:12, Moritz Wenk wrote:
Hello,

Is this a bug in QsciScintilla::annotation() (from qsciscintilla.cpp
in version 2.14.1) ? The variable “buf” is never initialized with
anything.

// Get the annotation for a line, if any.
QString QsciScintilla::annotation(int line) const
{
int size = SendScintilla(SCI_ANNOTATIONGETTEXT, line, (const char *)0);
    char *buf = new char[size + 1];

    QString qs = bytesAsText(buf, size);
    delete[] buf;

    return qs;
}

I think there is a call for SendScintilla() missing:

char *buf = new char[size + 1];
SendScintilla(SCI_ANNOTATIONGETTEXT, line, (char *)buf);

You're right, the call is missing.

Thanks,
Phil

Reply via email to