diff --git a/ubb-vga/tstimg.c b/ubb-vga/tstimg.c index fc35e25..a5e7330 100644 --- a/ubb-vga/tstimg.c +++ b/ubb-vga/tstimg.c @@ -86,15 +86,15 @@ static void grill(void **f, int ares, int bres, int swap) int n, o; int i, a, b; - n = ares/GRID+1; - o = (ares % GRID)/2; + n = (ares-1)/GRID+1; + o = ((ares-1) % GRID)/2; if (!(n & 1)) { n--; o += GRID/2; } for (i = 0; i != n; i++) { a = o+i*GRID; - for (b = 0; b != bres; b++) + for (b = 0; b != bres-1; b++) if (swap) pixel(f, bres, b, a, WHITE); else