fix crash, and improve makefile
authorMatthew McPherrin <matthew@mcpherrin.ca>
Wed, 27 Jun 2012 20:11:00 +0000 (16:11 -0400)
committerMatthew McPherrin <matthew@mcpherrin.ca>
Wed, 27 Jun 2012 20:11:00 +0000 (16:11 -0400)
Makefile
shit.c

index 8b91e2f..9e66a2f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -381,6 +381,6 @@ clean_list :
        clean clean_list program
 
 
-CFLAGS=-Wall
-blit_fb:
-       /usr/bin/c99 shit.c -lpng -o blit_fb
+CFLAGS=-Wall -ggdb
+blit_fb: shit.c
+       /usr/bin/c99 ${CFLAGS} shit.c -lpng -o blit_fb
diff --git a/shit.c b/shit.c
index 3281463..5ed2967 100644 (file)
--- a/shit.c
+++ b/shit.c
@@ -83,7 +83,7 @@ int main(int argc, char** argv)
 
     // dump this shit to a framebuffer nigga
     assert(vinfo.bits_per_pixel == 32);
-    for (int y = 0; y < MIN(info_ptr->height, vinfo.yres); ++y) {
+    for (int y = 0; y < MIN(info_ptr->height, vinfo.yres-2); ++y) {
       for (int x = 0; x < MIN(info_ptr->width, channels*vinfo.xres); ++x) {
         assert(x*y*3 < channels*screensize);
         location = (x+vinfo.xoffset) * (vinfo.bits_per_pixel/8) +