[PATCH] Re: What not to be doing - syscall()
Frans Englich
frans.englich at telia.com
Wed Dec 24 17:59:35 GMT 2003
On Tuesday 23 December 2003 21:13, Thiago Macieira wrote:
> Frans Englich wrote:
> >+ const char *user = KUser().loginName().latin1();
>
> I have a problem with that, in your last patch. The QString object the from
> which you're getting the Latin1 is a temporary object and will be destroyed
> shortly thereafter, so the variable will point to a deallocated pointer.
> Use a QCString there for user or keep the QString around.
Ok, second try. This time no dangling pointer, but latin1 is kept - I let you
fight over that ;-)
But what Lukás comments could be valid, what does the posix/de-facto(or
whatever in charge) say about unix logins? Is everything but ascii
disallowed?
(the other two is unchanged)
Frans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getlogin.kdebase.diff
Type: text/x-diff
Size: 1031 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031224/cedb6bef/attachment.diff>
More information about the kde-core-devel
mailing list