From d4fec7949e72d3ec1feba34d2571153d939b9cd1 Mon Sep 17 00:00:00 2001 From: Paul Carpenter Date: Wed, 3 Oct 2018 00:02:36 +0100 Subject: [PATCH] V1.04 Fix wrong numbers reported from available() PS2KeyRaw::available()reported wrong numbers empty or unused bytes Simplify function --- src/PS2KeyRaw.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/PS2KeyRaw.cpp b/src/PS2KeyRaw.cpp index 0e496e7..527a1cd 100644 --- a/src/PS2KeyRaw.cpp +++ b/src/PS2KeyRaw.cpp @@ -1,4 +1,4 @@ -/* Version V1.0.2 +/* Version V1.0.4 PS2KeyRaw.cpp - PS2KeyRaw library Copyright (c) 2007 Free Software Foundation. All right reserved. Written by Paul Carpenter, PC Services @@ -136,9 +136,7 @@ int8_t PS2KeyRaw::available() { int8_t i; -if( tail == head ) - return false; -i = tail - head; +i = head - tail; if( i < 0 ) i += BUFFER_SIZE; return i;