Skip to content

Commit

Permalink
semihosting: don't send the trailing '\0'
Browse files Browse the repository at this point in the history
Don't send the trailing 0 from the string.

Signed-off-by: KONRAD Frederic <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
KONRAD Frederic authored and stsquad committed Jul 27, 2020
1 parent 619985e commit 7d2d652
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hw/semihosting/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ static GString *copy_user_string(CPUArchState *env, target_ulong addr)

do {
if (cpu_memory_rw_debug(cpu, addr++, &c, 1, 0) == 0) {
s = g_string_append_c(s, c);
if (c) {
s = g_string_append_c(s, c);
}
} else {
qemu_log_mask(LOG_GUEST_ERROR,
"%s: passed inaccessible address " TARGET_FMT_lx,
Expand Down

0 comments on commit 7d2d652

Please sign in to comment.