Bug 79986 - 'Attach to process dialog' incorrectly adds spaces into 'ps ax' output
Summary: 'Attach to process dialog' incorrectly adds spaces into 'ps ax' output
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: 3.0.3
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-20 09:25 UTC by Michal Ceresna
Modified: 2005-03-12 05:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
psdialog patch (976 bytes, patch)
2004-04-20 09:26 UTC, Michal Ceresna
Details

Note You need to log in before you can comment on or make changes to this bug.
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);
 }