summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2014-11-19 18:24:53 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2014-11-19 18:24:53 +0000
commitcb05772f8e406eb1908f8b2fed3679ee6da3b9fd (patch)
tree7d45def7ceb2fd5ecfc7b702082db654d0b255fe
parent544e0fcba356befb861862aa23706de1e0d7187b (diff)
Bounds-check array before attempting to test for sentinel NULs in it
-rw-r--r--t/harness.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/harness.c b/t/harness.c
index 04bbcd6..e346d71 100644
--- a/t/harness.c
+++ b/t/harness.c
@@ -762,7 +762,7 @@ int main(int argc, char **argv)
if(!vterm_screen_get_cell(screen, pos, &cell))
goto abort_line;
printf("{");
- for(int i = 0; cell.chars[i] && i < VTERM_MAX_CHARS_PER_CELL; i++) {
+ for(int i = 0; i < VTERM_MAX_CHARS_PER_CELL && cell.chars[i]; i++) {
printf("%s0x%x", i ? "," : "", cell.chars[i]);
}
printf("} width=%d attrs={", cell.width);