diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gui/2d-primitives.c | 4 | ||||
-rw-r--r-- | lib/gui/graphic_utils.c | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/gui/2d-primitives.c b/lib/gui/2d-primitives.c index 0f29b32bab..89acc092d5 100644 --- a/lib/gui/2d-primitives.c +++ b/lib/gui/2d-primitives.c @@ -61,7 +61,7 @@ static void draw_simple_line(struct screen *sc, swap(y1, y2); } - for (x = x1; x < x2 - 1; x++) { + for (x = x1; x <= x2; x++) { if (!dash || (++pixel % (2 * dash)) < dash) illuminate(sc->info, @@ -137,7 +137,7 @@ void gu_draw_line(struct screen *sc, j = y1; eps = dy - dx; - for (i = x1; i <= x2 - 1; i++) { + for (i = x1; i <= x2; i++) { if (!dash || (++pixel % (2 * dash)) > dash) { illuminate(sc->info, diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c index 7d238e9ff9..0bed932213 100644 --- a/lib/gui/graphic_utils.c +++ b/lib/gui/graphic_utils.c @@ -285,15 +285,13 @@ struct screen *fb_open(const char * fbdev) sc = fb_create_screen(info); if (IS_ERR(sc)) { ret = PTR_ERR(sc); - goto failed_create; + goto failed_screeninfo; } sc->fd = fd; return sc; -failed_create: - free(sc); failed_screeninfo: close(fd); |