On 2014-09-24 19:11, Philipp A. Hartmann wrote:
I would probably do it like this (untested):

    const char *path =
        QFile::encodeName(fi.absoluteFilePath()).constData();

QFile::encodeName returns a temporary QByteArray, and getting a
pointer to its internal char* will cause it to be a dangling pointer.

  const QByteArray path = QFile::encodeName(fi.absoluteFilePath());

and then use path.constData() whenever needed.

        std::vector<char> s(sb.st_size + 1);

Please use QByteArray instead.

--
Pino Toscano


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: 
https://lists.debian.org/[email protected]

Reply via email to