aboutsummaryrefslogtreecommitdiff
path: root/sim/d10v/interp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sim/d10v/interp.c')
-rw-r--r--sim/d10v/interp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index e465a80..0f7295d 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -715,7 +715,7 @@ xfer_mem (SIM_ADDR virt,
{
int xfered = 0;
- while (xfered < size)
+ while (0 < size)
{
uint8 *memory;
unsigned long phys;
@@ -754,9 +754,10 @@ xfer_mem (SIM_ADDR virt,
virt += phys_size;
buffer += phys_size;
xfered += phys_size;
+ size -= phys_size;
}
- return size;
+ return xfered;
}