summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-04-15 21:29:57 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-04-15 21:29:57 +0200
commit7f53337609dda8f22497fe35850b68a554434008 (patch)
treef723214dfe1b2ccef07de245d4debd1cff1ebdab
parent70679a1b72ccf9fc008ff431563856efc82aeeef (diff)
Fix bug in tape printer of bfinter2.c
-rw-r--r--bfinter2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfinter2.c b/bfinter2.c
index 8801090..924d35f 100644
--- a/bfinter2.c
+++ b/bfinter2.c
@@ -184,7 +184,7 @@ static void p_run(const struct program p){
case IDEBUG: {
int low=0,high=memsize-1;
while(low<startidx&&mem[low]==0)low++;
- while(high>startidx&&mem[high]==0)high++;
+ while(high>startidx&&mem[high]==0)high--;
for(int i=low;i<=high;i++){
fprintf(stderr,"%3u ",(unsigned)mem[i]);
}