aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-12-26 15:13:05 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-03-07 15:24:33 +0000
commit23908d9277b3c41c294102993875cf485db689cb (patch)
tree7414d806c42a9ada0405ad6290d431a6238cee2d /csi.c
parentterm_fill(): make sure the filled cells have their ‘clean’ bit reset (diff)
term_fill(): change ‘character’ parameter from char -> uint8_t
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/csi.c b/csi.c
index 558c2dc2..494ac957 100644
--- a/csi.c
+++ b/csi.c
@@ -1924,26 +1924,27 @@ csi_dispatch(struct terminal *term, uint8_t final)
}
case 'x': { /* DECFRA */
- const char c = vt_param_get(term, 0, 0);
- if (likely((c >= 32 && c < 126) ||
- (c >= 160 && c <= 255)))
- {
- int top, left, bottom, right;
- if (!params_to_rectangular_area(
- term, 1, &top, &left, &bottom, &right))
- {
- break;
- }
+ const uint8_t c = vt_param_get(term, 0, 0);
- /* Erase the entire region at once (MUCH cheaper than
- * doing it row by row, or even character by
- * character). */
- sixel_overwrite_by_rectangle(
- term, top, left, bottom - top + 1, right - left + 1);
+ if (unlikely(!((c >= 32 && c < 126) || c >= 160)))
+ break;
- for (int r = top; r <= bottom; r++)
- term_fill(term, r, left, c, right - left + 1, true);
+ int top, left, bottom, right;
+ if (!params_to_rectangular_area(
+ term, 1, &top, &left, &bottom, &right))
+ {
+ break;
}
+
+ /* Erase the entire region at once (MUCH cheaper than
+ * doing it row by row, or even character by
+ * character). */
+ sixel_overwrite_by_rectangle(
+ term, top, left, bottom - top + 1, right - left + 1);
+
+ for (int r = top; r <= bottom; r++)
+ term_fill(term, r, left, c, right - left + 1, true);
+
break;
}