From 7af4abab649d1ea4f9c8289a58b9d479237bd815 Mon Sep 17 00:00:00 2001 From: kh1 Date: Wed, 11 Nov 2009 15:05:28 +0100 Subject: On windows we need to pass the length read to function properly. The buffer might still contain garbage from an already received command. Reviewed-by: ck --- tools/assistant/tools/assistant/remotecontrol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/assistant/tools/assistant/remotecontrol.cpp b/tools/assistant/tools/assistant/remotecontrol.cpp index 474a681..ac7e16f 100644 --- a/tools/assistant/tools/assistant/remotecontrol.cpp +++ b/tools/assistant/tools/assistant/remotecontrol.cpp @@ -97,9 +97,9 @@ void StdInListenerWin::run() #endif while (ok) { - ok = ReadFile(hStdinDup, chBuf, 4096, &dwRead, NULL); + ok = ReadFile(hStdinDup, chBuf, sizeof(chBuf), &dwRead, NULL); if (ok && dwRead != 0) - emit receivedCommand(QString::fromLocal8Bit(chBuf)); + emit receivedCommand(QString::fromLocal8Bit(chBuf, dwRead)); } } #endif -- cgit v0.12