uterm: video: fix blit() and fill() height adjustments
authorDavid Herrmann <dh.herrmann@googlemail.com>
Tue, 31 Jul 2012 11:35:18 +0000 (13:35 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Tue, 31 Jul 2012 11:35:18 +0000 (13:35 +0200)
Whoops, we missed the last line for all blit()/fill() operations. Fix the
decrement to correctly count as many lines as given.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/uterm_video_dumb.c
src/uterm_video_fbdev.c

index 754e3ee..a1195a7 100644 (file)
@@ -404,7 +404,7 @@ static int display_blit(struct uterm_display *disp,
        dst = &dst[y * rb->stride + x * 4];
        src = buf->data;
 
-       while (--height) {
+       while (height--) {
                memcpy(dst, src, 4 * width);
                dst += rb->stride;
                src += buf->stride;
@@ -446,7 +446,7 @@ static int display_fill(struct uterm_display *disp,
        dst = rb->map;
        dst = &dst[y * rb->stride + x * 4];
 
-       while (--height) {
+       while (height--) {
                for (i = 0; i < width; ++i) {
                        ((uint32_t*)dst)[i] = ((r & 0xff) << 16) |
                                              ((g & 0xff) << 8) |
index eb3d79e..9bd0134 100644 (file)
@@ -371,7 +371,7 @@ static int display_blit(struct uterm_display *disp,
        dst = &dst[y * disp->fbdev.stride + x * disp->fbdev.bpp];
        src = buf->data;
 
-       while (--height) {
+       while (height--) {
                memcpy(dst, src, 4 * width);
                dst += disp->fbdev.stride;
                src += buf->stride;
@@ -410,7 +410,7 @@ static int display_fill(struct uterm_display *disp,
                dst = &disp->fbdev.map[disp->fbdev.yres * disp->fbdev.stride];
        dst = &dst[y * disp->fbdev.stride + x * disp->fbdev.bpp];
 
-       while (--height) {
+       while (height--) {
                for (i = 0; i < width; ++i) {
                        ((uint32_t*)dst)[i] = ((r & 0xff) << 16) |
                                              ((g & 0xff) << 8) |