From 0559308ee4ce463b87de410c053435bdf12f73d8 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 11 Sep 2017 15:44:23 -0700 Subject: [PATCH] IBM1130: Fix Coverity identified PTR positioning bookkeeping --- Ibm1130/ibm1130_ptrp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Ibm1130/ibm1130_ptrp.c b/Ibm1130/ibm1130_ptrp.c index e71b6b48..030064c2 100644 --- a/Ibm1130/ibm1130_ptrp.c +++ b/Ibm1130/ibm1130_ptrp.c @@ -127,10 +127,11 @@ static t_stat ptr_svc (UNIT *uptr) if (IS_ONLINE(uptr)) { /* fetch character from file */ ptr_char = getc(uptr->fileref); - uptr->pos++; - if (! feof(uptr->fileref)) /* there's more left */ + if (! feof(uptr->fileref)) { /* there's more left */ CLRBIT(ptr_dsw, PTR1134_DSW_READER_NOT_READY); + uptr->pos++; + } } SETBIT(ptr_dsw, PTR1134_DSW_READER_RESPONSE); /* indicate read complete */