[6792] fread_targphys(): Do not cut off the tail.
Revision: 6792
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6792 Author: blueswir1 Date: 2009-03-09 18:08:56 +0000 (Mon, 09 Mar 2009)
Log Message:
-----------fread_targphys(): Do not cut off the tail.
loader.c:fread_targphys() read file by 4096 byte chunks and store them to memory. But did not store the last chunk if its size was not 4096.
Signed-off-by Takashi YOSHII <[email protected]>
Modified Paths:
--------------
trunk/loader.c
Modified: trunk/loader.c
===================================================================
loader.c +2 -1
@@ -90,11 +90,12 @@while (nbytes) { want = nbytes >sizeof (buf) ?sizeof (buf) : nbytes; did =fread (buf,1 , want, f); -if (did != want)break ;cpu_physical_memory_write_rom (dst_addr, buf, did); dst_addr += did; nbytes -= did; +if (did != want) +break ; }return dst_addr - dst_begin; }