Skip to content

Commit d4fec79

Browse files
authored
V1.04 Fix wrong numbers reported from available()
PS2KeyRaw::available()reported wrong numbers empty or unused bytes Simplify function
1 parent 68f7952 commit d4fec79

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/PS2KeyRaw.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Version V1.0.2
1+
/* Version V1.0.4
22
PS2KeyRaw.cpp - PS2KeyRaw library
33
Copyright (c) 2007 Free Software Foundation. All right reserved.
44
Written by Paul Carpenter, PC Services <[email protected]>
@@ -136,9 +136,7 @@ int8_t PS2KeyRaw::available()
136136
{
137137
int8_t i;
138138

139-
if( tail == head )
140-
return false;
141-
i = tail - head;
139+
i = head - tail;
142140
if( i < 0 )
143141
i += BUFFER_SIZE;
144142
return i;

0 commit comments

Comments
 (0)