stop addr++ in interactive loop
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 19 Oct 2018 22:40:15 +0000 (23:40 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 19 Oct 2018 22:40:15 +0000 (23:40 +0100)
riscv/interactive.cc

index afe6d1338ddca19ad8a1dc7a9e55d57f47616ede..adb9954579eff4f65cf0f68e47af8cdffa4cc970 100644 (file)
@@ -316,8 +316,10 @@ void sim_t::interactive_str(const std::string& cmd, const std::vector<std::strin
   reg_t addr = strtol(args[0].c_str(),NULL,16);
 
   char ch;
-  while((ch = debug_mmu->load_uint8(addr++)))
+  while((ch = debug_mmu->load_uint8(addr))) {
     putchar(ch);
+    addr += 1;
+  }
 
   putchar('\n');
 }