summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-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)
167 if (fd < 0) 167 if (fd < 0)
168 return; 168 return;
169 169
170 write(fd, bmpheader, sizeof(bmpheader)); 170 if(write(fd, bmpheader, sizeof(bmpheader)) != sizeof(bmpheader))
171 {
172 close(fd);
173 return;
174 }
171 SDL_LockSurface(lcd_surface); 175 SDL_LockSurface(lcd_surface);
172 176
173 /* BMP image goes bottom up */ 177 /* BMP image goes bottom up */
@@ -191,7 +195,11 @@ void screen_dump(void)
191 dst_mask = 0x80; 195 dst_mask = 0x80;
192 } 196 }
193 } 197 }
194 write(fd, line, sizeof(line)); 198 if(write(fd, line, sizeof(line)) != sizeof(line))
199 {
200 close(fd);
201 return;
202 }
195 } 203 }
196 SDL_UnlockSurface(lcd_surface); 204 SDL_UnlockSurface(lcd_surface);
197 close(fd); 205 close(fd);