From de351220433ef40e078998c9bc31e178b956c94f Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Tue, 10 Mar 2015 07:45:25 +0000
Subject: [PATCH] Fix bug introduced Jan, 2014 parsing CSI x f or CSI x H with
 a single digit single argument.  Imapged Global War continent maps at least.

Thanks for the bug report Digital Man!
---
 src/conio/cterm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conio/cterm.c b/src/conio/cterm.c
index bc4c9115ca..46cbd7329c 100644
--- a/src/conio/cterm.c
+++ b/src/conio/cterm.c
@@ -1408,7 +1408,7 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int *
 						max_row = cterm->bottom_margin - cterm->top_margin + 1;
 					col=1;
 					*p=0;
-					if(strlen(cterm->escbuf)>2) {
+					if(strlen(cterm->escbuf)>1) {	// Remember, we truncated the 'H' or 'f'
 						if((p=strtok(cterm->escbuf+1,";"))!=NULL) {
 							row=strtoul(p,NULL,10);
 							if((p=strtok(NULL,";"))!=NULL) {
-- 
GitLab