From 16ac328f4149eb1568496d1fff56edc8c03b28bf Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Wed, 14 Oct 2026 19:13:16 -0300
Subject: tdehw: stop cpuinfo reads at actual EOF
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 tdecore/tdehw/tdehardwaredevices.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp
index 2471c8341..a61cfb77c 100644
--- a/tdecore/tdehw/tdehardwaredevices.cpp
+++ b/tdecore/tdehw/tdehardwaredevices.cpp
@@ -187,8 +187,11 @@ TDEHardwareDevices::TDEHardwareDevices() {
 		TQFile cpufile( "/proc/cpuinfo" );
 		if ( cpufile.open( IO_ReadOnly ) ) {
 			TQTextStream stream( &cpufile );
-			while ( !stream.atEnd() ) {
-				m_cpuInfo.append(stream.readLine());
+			TQString line;
+			// A null string indicates EOF; empty lines are valid CPU info separators.
+			while ( !(line = stream.readLine()).isNull() )
+			{
+				m_cpuInfo.append( line );
 			}
 			cpufile.close();
 		}
-- 
cgit v1.2.3

