From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: konrad@adacore.com, qemu-devel@nongnu.org
Cc: KONRAD Frederic <frederic.konrad@adacore.com>, alex.bennee@linaro.org
Subject: Re: [PATCH v1 2/2] semihosting: don't send the trailing '\0'
Date: Mon, 15 Jun 2020 12:13:29 +0200 [thread overview]
Message-ID: <fff8f08b-5fbe-93ff-d0e9-c45940f649c6@redhat.com> (raw)
In-Reply-To: <1592215252-26742-2-git-send-email-frederic.konrad@adacore.com>
On 6/15/20 12:00 PM, konrad@adacore.com wrote:
> From: KONRAD Frederic <frederic.konrad@adacore.com>
>
> Don't send the trailing 0 from the string.
>
Fixes: a331c6d7741
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
> ---
> hw/semihosting/console.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/semihosting/console.c b/hw/semihosting/console.c
> index 22e7827..9b4fee9 100644
> --- a/hw/semihosting/console.c
> +++ b/hw/semihosting/console.c
> @@ -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,
>
next prev parent reply other threads:[~2020-06-15 10:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-15 10:00 [PATCH v1 1/2] semihosting: defer connect_chardevs a little more to use serialx konrad
2020-06-15 10:00 ` [PATCH v1 2/2] semihosting: don't send the trailing '\0' konrad
2020-06-15 10:13 ` Philippe Mathieu-Daudé [this message]
2020-06-16 15:14 ` Alex Bennée
2020-06-16 14:52 ` [PATCH v1 1/2] semihosting: defer connect_chardevs a little more to use serialx Alex Bennée
2020-06-26 10:06 ` Fred Konrad
2020-07-15 11:04 ` Fred Konrad
2020-07-16 10:14 ` Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fff8f08b-5fbe-93ff-d0e9-c45940f649c6@redhat.com \
--to=philmd@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=frederic.konrad@adacore.com \
--cc=konrad@adacore.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).