[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: kdenonbeta/kopete/protocols/gadu
From:       Duncan Mac-Vicar Prett <duncan () kde ! org>
Date:       2002-10-01 0:12:28
[Download RAW message or body]

El Monday 30 September 2002 19:50, Zack Rusin escribió:
> strcpy doesn't allocate memory, strdup does. p.password is just a
> pointer and doesnt' have momory for the string allocated to it. latin1()
> returns a const char* pointer valid for as long as the QString is there,
> which in this case is the lifetime of that function, that's all we want,
> we don't want to be unnecessarily copying/allocating memory.
>
> Zack

ok, but redhat's compiler fails in that line, and 2.95.4 gives a warning, what 
about this?

p.password = const_cast<char *>(password.latin1());

is that better?
Duncan

-- 
   .-.
   /v\    Duncan Mac-Vicar Prett
  // \\   duncan@puc.cl - duncan@kde.org
 /(   )\  www.mac-vicar.com/duncan
  ^^-^^
 Kopete, The KDE Instant Messenger
 http://kopete.kde.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic