summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/sdl
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2012-04-03 20:59:11 +0200
committerFrank Gevaerts <frank@gevaerts.be>2012-04-03 20:59:11 +0200
commit9ca9b657e4f1d9481cc795422d74274abf9d41f1 (patch)
tree58d3f14094bcff5bc8c08c588f2e3931f9222578 /firmware/target/hosted/sdl
parent1207c7b6416084624aeeb78ba8222d9a4ca49d94 (diff)
downloadrockbox-9ca9b657e4f1d9481cc795422d74274abf9d41f1.tar.gz
rockbox-9ca9b657e4f1d9481cc795422d74274abf9d41f1.zip
Revert 1207c7b and fix the actual warnings.
The warnings 1207c7b was supposed to get rid of are sim-only. This means the binsize argument used for the _FORTIFY_SOURCE fix did not apply at all. This one actually checks the return values. Change-Id: Ic4cd8c25de4305310baa868c077a66981cdfcb4b
Diffstat (limited to 'firmware/target/hosted/sdl')
-rw-r--r--firmware/target/hosted/sdl/lcd-charcells.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/firmware/target/hosted/sdl/lcd-charcells.c b/firmware/target/hosted/sdl/lcd-charcells.c
index 9ceb5de391..3a623827db 100644
--- a/firmware/target/hosted/sdl/lcd-charcells.c
+++ b/firmware/target/hosted/sdl/lcd-charcells.c
@@ -167,7 +167,11 @@ void screen_dump(void)
if (fd < 0)
return;
- write(fd, bmpheader, sizeof(bmpheader));
+ if(write(fd, bmpheader, sizeof(bmpheader)) != sizeof(bmpheader))
+ {
+ close(fd);
+ return;
+ }
SDL_LockSurface(lcd_surface);
/* BMP image goes bottom up */
@@ -191,7 +195,11 @@ void screen_dump(void)
dst_mask = 0x80;
}
}
- write(fd, line, sizeof(line));
+ if(write(fd, line, sizeof(line)) != sizeof(line))
+ {
+ close(fd);
+ return;
+ }
}
SDL_UnlockSurface(lcd_surface);
close(fd);