[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kdiff3: FTBFS on hurd-i386 (for review)



On 2014-09-25 14:05, Svante Signell wrote:
Hi Pino

On Thu, 2014-09-25 at 10:08 +0200, Pino Toscano wrote:
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.

Ok now?

You've forgot the second part of what I said.

--
Pino Toscano


Reply to: