From 2261ed4b795522cfea52fa0e919c2d9187e9d650 Mon Sep 17 00:00:00 2001 From: nowrep Date: Tue, 4 Feb 2014 14:52:39 +0100 Subject: [PATCH] Fixed previous commit Ooops, it should actually check the return value, not just ignore it... --- src/lib/3rdparty/processinfo.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/3rdparty/processinfo.cpp b/src/lib/3rdparty/processinfo.cpp index 79e5cbb63..4002c1099 100644 --- a/src/lib/3rdparty/processinfo.cpp +++ b/src/lib/3rdparty/processinfo.cpp @@ -84,7 +84,10 @@ pid_t ProcessInfo::GetPIDbyName(const char* cchrptr_ProcessName) const FILE* fd_CmdLineFile = fopen(chrarry_CommandLinePath, "rt") ; // open the file for reading text if (fd_CmdLineFile) { int r = fscanf(fd_CmdLineFile, "%20s", chrarry_NameOfProcess) ; // read from /proc//cmdline - Q_UNUSED(r) + + if (r < 1) { + continue; + } fclose(fd_CmdLineFile); // close the file prior to exiting the routine