From edd52b4b2865457a47a37465dde4e150879c5c14 Mon Sep 17 00:00:00 2001 From: Ralf Grillenberger Date: Wed, 10 Feb 2010 22:43:01 +0000 Subject: [PATCH] Return the last byte from the serial FIFO buffer in case it is empty, not an unrelated one. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3547 --- include/serialport.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/serialport.h b/include/serialport.h index 5879a444..64476e1b 100644 --- a/include/serialport.h +++ b/include/serialport.h @@ -100,8 +100,9 @@ public: Bit8u getb() { if (!used) return data[pos]; Bitu where=pos; - if (++pos>=size) pos-=size; used--; + if(used) pos++; + if (pos>=size) pos-=size; return data[where]; } Bit8u getTop() {