Skip to content

Instantly share code, notes, and snippets.

@saitoha
Last active December 17, 2015 13:49
Show Gist options
  • Select an option

  • Save saitoha/5620239 to your computer and use it in GitHub Desktop.

Select an option

Save saitoha/5620239 to your computer and use it in GitHub Desktop.
jfbterm - fix CPR off-by-one issue
Index: vterm.c
===================================================================
RCS file: /cvsroot/jfbterm/jfbterm/vterm.c,v
retrieving revision 1.20
diff -u -r1.20 vterm.c
--- vterm.c 10 May 2004 18:08:47 -0000 1.20
+++ vterm.c 21 May 2013 14:50:03 -0000
@@ -1114,7 +1114,7 @@
if (arg == 6) {
int x = (p->pen.x < p->xmax-1) ? p->pen.x : p->xmax-1;
int y = (p->pen.y < p->ymax-1) ? p->pen.y : p->ymax-1;
- sprintf(p->report, "\x1B[%d;%dR", y, x);
+ sprintf(p->report, "\x1B[%d;%dR", y + 1, x + 1);
} else if (arg == 5) {
strcpy(p->report, "\x1B[0n\0");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment