fix a bug in CopyStringOut. dprintk appears to work again.
authorAli Saidi <saidi@eecs.umich.edu>
Fri, 13 Oct 2006 18:28:46 +0000 (14:28 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Fri, 13 Oct 2006 18:28:46 +0000 (14:28 -0400)
--HG--
extra : convert_revision : cd0d13a85ddc7599308db8604a8f63a48679cc05

src/arch/alpha/vtophys.cc

index f7fd92c1574bb53a6d9a01523c182a1ab2d138db..fd8f781e41c78b474d77aa36ce4e00c47ee19989 100644 (file)
@@ -141,12 +141,12 @@ void
 AlphaISA::CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen)
 {
     int len = 0;
+    char *start = dst;
     VirtualPort *vp = tc->getVirtPort(tc);
 
     do {
         vp->readBlob(vaddr++, (uint8_t*)dst++, 1);
-        len++;
-    } while (len < maxlen && dst[len] != 0 );
+    } while (len < maxlen && start[len++] != 0 );
 
     tc->delVirtPort(vp);
     dst[len] = 0;