--- load.c.151	2009-04-26 15:51:11.000000000 +0100
+++ load.c	2009-04-26 16:02:35.000000000 +0100
@@ -402,7 +402,7 @@
             }
 
             // Copy data into memory
-            while (len-- > 0) {
+            while (len > 0) {
 #ifdef CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS
                 if (!(valid_address(addr) 
 #ifdef CYGBLD_REDBOOT_LOAD_INTO_FLASH
@@ -414,26 +414,39 @@
                     return 0;
                 }
 #endif
-                if ((ch = (*getc)()) < 0) {
-                    err_printf(SHORT_DATA);
-                    redboot_getc_terminate(true);
-                    return 0;
-                }
-#ifdef CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS
-                if (valid_address(addr)) 
-#endif
-                  *addr++ = ch;
-                
-#ifdef CYGBLD_REDBOOT_LOAD_INTO_FLASH
-                else {
-                  flash_load_write(addr, ch);
-                  addr++;
-                }
-#endif
-                offset++;
-                if ((unsigned long)(addr-addr_offset) > highest_address) {
-                    highest_address = (unsigned long)(addr - addr_offset);
-                }
+
+		getc_info.bufp = getc_info.buf;
+		getc_info.len = (*getc_info.fun)(getc_info.bufp, read_size, &getc_info.err);
+		getc_info.avail = getc_info.len;
+
+		for (i =0; i < getc_info.len; i++)
+		{
+    #ifdef CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS
+		    if (valid_address(addr)) 
+    #endif
+		      *addr++ = *getc_info.bufp++;
+		    
+    #ifdef CYGBLD_REDBOOT_LOAD_INTO_FLASH
+		    else {
+		      flash_load_write(addr, *getc_info.bufp++);
+		      addr++;
+		    }
+    #endif
+		      // knock off what was read
+		      len--;
+		      getc_info.avail--;
+
+		    if (getc_info.err < 0) {
+			err_printf(SHORT_DATA);
+			redboot_getc_terminate(true);
+			return 0;
+		    }
+
+		    offset++;
+		    if ((unsigned long)(addr-addr_offset) > highest_address) {
+			highest_address = (unsigned long)(addr - addr_offset);
+		    }
+		}
             }
         }
     }

