Bug 79986

Summary: 'Attach to process dialog' incorrectly adds spaces into 'ps ax' output
Product: [Applications] kdevelop Reporter: Michal Ceresna <michal.ceresna>
Component: CPP DebuggerAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.0.3   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: psdialog patch

Description Michal Ceresna 2004-04-20 09:25:42 UTC
Version:           3.0.3, cvs (using KDE KDE 3.2.1)
Installed from:    Compiled From Sources
Compiler:          gcc version 3.3.3 (Debian 20040306)
 
OS:          Linux

the 'ps' output lines in the dialog contain randomly
inserted spaces, because of the '+1' in the slotReceivedOutput()

QT:3.2.3
Comment 1 Michal Ceresna 2004-04-20 09:26:29 UTC
Created attachment 5706 [details]
psdialog patch
Comment 2 Jens Dagerbo 2005-01-16 22:48:55 UTC
I can't reproduce the problem. Everything looks good here. Anyone?
Comment 3 Matt Rogers 2005-03-12 05:50:23 UTC
CVS commit by mattr: 

Fix bug 79986. Don't add one to the length since it would technically be
out of bounds of the current string. Thanks for the patch. :)

BUGS: 79986


  M +1 -1      dbgpsdlg.cpp   1.14


--- kdevelop/languages/cpp/debugger/dbgpsdlg.cpp  #1.13:1.14
@@ -140,5 +140,5 @@ int Dbg_PS_Dialog::pidSelected()
 void Dbg_PS_Dialog::slotReceivedOutput(KProcess */*proc*/, char *buffer, int buflen)
 {
-    pidLines_ += QString::fromLocal8Bit(buffer, buflen+1);
+    pidLines_ += QString::fromLocal8Bit(buffer, buflen);
 }
 
Comment 4 Matt Rogers 2005-03-12 05:51:11 UTC
CVS commit by mattr: 

Backport the fix for 79986. It should be in KDevelop 3.2.1
CCBUG: 79986


  M +1 -1      dbgpsdlg.cpp   1.13.4.1


--- kdevelop/languages/cpp/debugger/dbgpsdlg.cpp  #1.13:1.13.4.1
@@ -140,5 +140,5 @@ int Dbg_PS_Dialog::pidSelected()
 void Dbg_PS_Dialog::slotReceivedOutput(KProcess */*proc*/, char *buffer, int buflen)
 {
-    pidLines_ += QString::fromLocal8Bit(buffer, buflen+1);
+    pidLines_ += QString::fromLocal8Bit(buffer, buflen);
 }