Roll our own qUtf8Printable()?

Berthold Stoeger bstoeger at mail.tuwien.ac.at
Sun Feb 25 22:05:02 PST 2018


On Montag, 26. Februar 2018 02:13:11 CET Thiago Macieira wrote:
> On domingo, 25 de fevereiro de 2018 15:00:38 PST Lubomir I. Ivanov wrote:
> > <bstoeger at mail.tuwien.ac.at> wrote:
> > > Dear all,

> suggested here:
> > > So what do you think about rolling our own helper function:
> > > 
> > > inline const char *qstring2c(const QString &s)
> > > {
> > > 
> > >         return s.toUtf8().constData();
> > > 
> > > }
> 
> The above is just wrong. The pointer that is returned is dangling, because
> the above code actually does:

Yes, you're right of course. My fault.

Berthold


More information about the subsurface mailing list