* debugger/mcs51/break.c, debugger/mcs51/cmd.c,
[fw/sdcc] / as / link / z80 / lkgb.c
index 55ae41ff7b020bc64f88c3742f8a5f5681c0edf2..fca7cd1e0c46f3096e69ddb595d3da2fad8a1079 100644 (file)
@@ -6,6 +6,7 @@
 
 #ifdef GAMEBOY
 
+#include <assert.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -182,8 +183,11 @@ VOID gb(int in)
     cart[0x014E/SEGSIZE][0x014E%SEGSIZE] = (unsigned char)((chk>>8)&0xFF);
     cart[0x014F/SEGSIZE][0x014F%SEGSIZE] = (unsigned char)(chk&0xFF);
 
-    for(i = 0; i < NBSEG; i++)
-      fwrite(cart[i], 1, SEGSIZE, ofp);
+    for(i = 0; i < NBSEG; i++) {
+      size_t res;
+      res = fwrite(cart[i], 1, SEGSIZE, ofp);
+      assert(res == SEGSIZE);
+    }
   }
 }