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

List:       kde-devel
Subject:    Re: small bug in KDE 1.1.1 BRANCH
From:       Harri Porten <porten () tu-harburg ! de>
Date:       1999-07-20 12:54:59
[Download RAW message or body]

Hasso Tepper wrote:
> 
> At 14:12 20.07.99 +0200, you wrote:
> >Could you try to debug the problem by putting printf()'s in
> >currentUser() in kscreensaver/saver.cpp ?
> 
> In the moment I can't but I will try later at home.

No need to do that anymore. I thin I found the bug. Do you have a comma
in the name field ? The algorithm to strip off everything after and
including the comma didn't take into account that QString::resize() from
Qt 1.x has the peculiarity to include the terminating '\0' into the
size.

--- saver.cpp   1999/06/24 11:38:11     1.13.4.3
+++ saver.cpp   1999/07/20 12:41:24
@@ -33,7 +33,7 @@
   QString fullname(current->pw_gecos);
   if (fullname.find(',') != -1)
     /* Remove everything from and including first comma */
-    fullname.resize(fullname.find(','));
+    fullname.resize(fullname.find(',')+1);
 
   QString username(current->pw_name);

Thanks and please test,

Harri.

P.S: cc'ed to Martin to ask for confirmation of correctness

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

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