Skip to content

Commit

Permalink
V1.04 Fix wrong numbers reported from available()
Browse files Browse the repository at this point in the history
PS2KeyRaw::available()reported wrong numbers empty or unused bytes

Simplify function
  • Loading branch information
techpaul authored Oct 2, 2018
1 parent 68f7952 commit d4fec79
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/PS2KeyRaw.cpp
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d4fec79

Please sign in to comment.