From dfc6162e91ce674d52050b733d6d44d66fb5c332 Mon Sep 17 00:00:00 2001
From: "ol.sc" 
Date: Sat, 26 Sep 2009 21:32:05 +0000
Subject: [PATCH] Fixed bug triggered if all 8 io buffer slots may be used.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4242 b7a2c559-68d2-44c3-8de9-860c34a00d81
---
 libsrc/apple2/extra/iobuf-0800.s | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libsrc/apple2/extra/iobuf-0800.s b/libsrc/apple2/extra/iobuf-0800.s
index 386d91988..02685fae7 100644
--- a/libsrc/apple2/extra/iobuf-0800.s
+++ b/libsrc/apple2/extra/iobuf-0800.s
@@ -27,11 +27,12 @@ initiobuf:
         ; Mark all remaining table entries as used
         tax
         lda     #$FF
+:       cpx     #MAX_FDS
+        bcc     :+
+        rts
 :       sta     table,x
         inx
-        cpx     #MAX_FDS
-        bcc     :-
-        rts
+        bne     :--             ; Branch always
 
 ; ------------------------------------------------------------------------
 
-- 
2.39.5