aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-13 15:16:24 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-13 15:16:24 -0400
commitfcae41e886e693dffe489e111b6c4f5540ffc418 (patch)
tree2d86214d5718dac98f512d93c501bc551cdec33d
parent563db15f881207a49f85df5b9358dabb6a8826c8 (diff)
downloadrunes-fcae41e886e693dffe489e111b6c4f5540ffc418.tar.gz
runes-fcae41e886e693dffe489e111b6c4f5540ffc418.zip
handle no CSI parameters properly
-rw-r--r--vt100.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/vt100.l b/vt100.l
index 45a7cb1..285893d 100644
--- a/vt100.l
+++ b/vt100.l
@@ -206,7 +206,7 @@ static void runes_vt100_extract_sm_params(
* separated by semicolons. */
buf[len] = '\0';
*nparams = 0;
- for (;;) {
+ while ((size_t)(pos - buf) < len) {
if (*nparams >= RUNES_VT100_CSI_MAX_PARAMS) {
fprintf(stderr, "max CSI parameter length exceeded\n");
break;