summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2013-08-04 23:53:10 +0200
committerKevin Chabowski <kevin@kch42.de>2013-08-04 23:53:10 +0200
commit8bb5248464cb483160e8a5c2aaa5e8a6061ffd1e (patch)
treedcac0d73e989ca140ca15856be53bac8e51b2bc8
parent8c5065f8a99eee0b0edeeab3d9a7f815fa4d50df (diff)
downloadnebula2-8bb5248464cb483160e8a5c2aaa5e8a6061ffd1e.tar.gz
nebula2-8bb5248464cb483160e8a5c2aaa5e8a6061ffd1e.tar.bz2
nebula2-8bb5248464cb483160e8a5c2aaa5e8a6061ffd1e.zip
Fixed BMP generation.
Fixed line padding.
-rw-r--r--bmp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/bmp.c b/bmp.c
index 7ee3750..5ca1594 100644
--- a/bmp.c
+++ b/bmp.c
@@ -91,10 +91,12 @@ bmp_write_pixel(bmp_write_handle_t* bmph, color_t col) {
return 0;
}
- if(--(bmph->line_left) == 0) {
- bmph->line_left = bmph->width;
-
- return (fwrite(padding, bmph->line_padding, 1, bmph->fh) == 1);
+ if(bmph->line_padding != 0) {
+ if(--(bmph->line_left) == 0) {
+ bmph->line_left = bmph->width;
+
+ return (fwrite(padding, bmph->line_padding, 1, bmph->fh) == 1);
+ }
}
return 1;