summaryrefslogtreecommitdiffhomepage
path: root/contrib/npclient/npclient.c
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-10 15:35:22 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-10 15:35:22 +0100
commit2eac169518ab341d1b99b1ac6c2a88ab4e850ce5 (patch)
tree2a4023413cea16ee3407d763a80f5bcfef6f7a14 /contrib/npclient/npclient.c
parentd283b2b8eb54c49b38bb9b60ea70e04d07eb5bbd (diff)
proto/ft: fix logic error
Diffstat (limited to 'contrib/npclient/npclient.c')
-rw-r--r--contrib/npclient/npclient.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/npclient/npclient.c b/contrib/npclient/npclient.c
index add5b4c1..42919d8f 100644
--- a/contrib/npclient/npclient.c
+++ b/contrib/npclient/npclient.c
@@ -349,8 +349,8 @@ NP_EXPORT(int) NP_GetData(tir_data_t * data)
else
{
running = false;
- // clamp to zero
- InterlockedExchange((LONG volatile*) &pMemData->data.DataID, -1);
+ // clamp to (-1) if still negative
+ (void)InterlockedCompareExchange((LONG volatile*) &pMemData->data.DataID, -1, data_id);
}
data->status = running ? NPCLIENT_STATUS_OK : NPCLIENT_STATUS_DISABLED;