OSDN Git Service

Copied from the private repository.
[kz-h8write/kz_h8write.git] / src / kz_h8write.c
index 753e36f..217d05f 100644 (file)
@@ -6,10 +6,9 @@
 
 /*
  * ===============================================================
- *  KOZOS h8write
- *  Version 0.1.0
+ *  KOZOS H8/3069F Flash Writer.
  * ===============================================================
- * Copyright (c) 2010-2011 Shinichiro Nakamura
+ * Copyright (c) 2010-2012 Shinichiro Nakamura
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -119,11 +118,12 @@ void mot_callback(
         const unsigned char *buf,
         const int siz)
 {
+    unsigned int lastaddr = addr + siz;
     for (int i = 0; i < siz; i++) {
         memory_image[addr + i] = buf[i];
     }
-    if (memory_lastaddr < addr) {
-        memory_lastaddr = addr;
+    if (memory_lastaddr < lastaddr) {
+        memory_lastaddr = lastaddr;
     }
 }