summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bluetooth/qlowenergycontroller_win.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bluetooth/qlowenergycontroller_win.cpp b/src/bluetooth/qlowenergycontroller_win.cpp
index 9f10a167..56382e69 100644
--- a/src/bluetooth/qlowenergycontroller_win.cpp
+++ b/src/bluetooth/qlowenergycontroller_win.cpp
@@ -143,8 +143,9 @@ static QString getServiceSystemPath(const QBluetoothAddress &deviceAddress,
deviceInterfaceDetailDataSize,
&deviceInterfaceDetailDataSize,
NULL)) {
- if (::GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
- *systemErrorCode = ::GetLastError();
+ const DWORD error = ::GetLastError();
+ if (error != ERROR_INSUFFICIENT_BUFFER) {
+ *systemErrorCode = error;
break;
}
}