Fix warnings in firmware/screendump.c

Change-Id: If01caf8a124e925b308bdefc6327420dde355ac9
This commit is contained in:
Franklin Wei 2015-02-24 16:55:26 -05:00
parent 17ee90ccdb
commit 55f1d9486f

View file

@ -140,7 +140,11 @@ void screen_dump(void)
} }
else else
{ {
write(fd, bmpheader, sizeof(bmpheader)); if(write(fd, bmpheader, sizeof(bmpheader)) != sizeof(bmpheader))
{
close(fd);
return;
}
/* BMP image goes bottom up */ /* BMP image goes bottom up */
for (y = LCD_HEIGHT - 1; y >= 0; y--) for (y = LCD_HEIGHT - 1; y >= 0; y--)
@ -243,7 +247,11 @@ void screen_dump(void)
while (dst < dst_end); while (dst < dst_end);
#endif /* LCD_DEPTH */ #endif /* LCD_DEPTH */
write(fd, linebuf, DUMP_BMP_LINESIZE); if(write(fd, linebuf, DUMP_BMP_LINESIZE) != DUMP_BMP_LINESIZE)
{
close(fd);
return;
}
} }
} }
close(fd); close(fd);