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
This commit is contained in:
Frank Gevaerts 2012-04-03 20:59:11 +02:00
parent 1207c7b641
commit 9ca9b657e4
2 changed files with 10 additions and 4 deletions

View file

@ -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);