From nobody Mon Feb 9 23:58:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1595399437; cv=none; d=zohomail.com; s=zohoarc; b=oJzwon/BpReyND8NvQb+uk9afNGG9UeU95NA+50VzzEmOj0L/2B36OhZ6ggKiWnShX8ub/0ediMxngIRQc3E0dkjmCA1dEs06tKpu69ViYl3t46KmDimXMOKPMcTGonOSq3xybixITBavd+paAtzoRAb+MgvGDLSYF4kGYMGgFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595399437; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FXawODYQMPXkW63coV0jaCgGZ0mloHIJB4WSMUcLFTA=; b=M/kO6A35577F9JRQCT6OKJc3FYSUzveEXxXcFPHV3XLuuud8BwsTvI4vbN4HHoVCrsbqvPwBAtETGUfKdYAbO2XDEeNYUTU29R42BqiwTGszKRqB0WycO8rjSXCyXGHEMkxj43wPJKKOd2767RdUrBFNHWvjKuK3wiOxPpc3BPc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159539943782698.931794589491; Tue, 21 Jul 2020 23:30:37 -0700 (PDT) Received: from localhost ([::1]:55448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jy8Gy-0000Om-Hd for importer@patchew.org; Wed, 22 Jul 2020 02:30:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jy8Fb-00071b-VH for qemu-devel@nongnu.org; Wed, 22 Jul 2020 02:29:11 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:33386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jy8Fa-0006uM-Gx for qemu-devel@nongnu.org; Wed, 22 Jul 2020 02:29:11 -0400 Received: by mail-wm1-x344.google.com with SMTP id a6so3659828wmm.0 for ; Tue, 21 Jul 2020 23:29:10 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 60sm15886664wrs.20.2020.07.21.23.29.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 23:29:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3E4761FF8F; Wed, 22 Jul 2020 07:29:03 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FXawODYQMPXkW63coV0jaCgGZ0mloHIJB4WSMUcLFTA=; b=KhwPHa9yjKnauoBpSsKJLnF0es/YzqGalAAoPgWCdfqgzK+Z93KpaN8CIXTgKoipid joLQcjIoNVGCZAaLep382LfuDFqvk13i8td7aDE8YF1OGfYg+EX+UmGQ9twfOYvlDnFH RojoGhlXU9xml5AJ+zQLhOUFdhdDMpKrTW+Yms8BZNw7n6xZhNFrfpUNmH6PP5iFnuQK qLMytkcii8r/tWQOD/mrYb8p0FE1v5D39SwWrz57qKu95QjOKJLNQx1DXzO7hdDWu6xG v1jxO5dJWWZCuf0Ql91r9t3tEB42Y/kGtlfiAMFnekTCPaOisGs/cqRZ4BJuP6oB5OPH N9Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FXawODYQMPXkW63coV0jaCgGZ0mloHIJB4WSMUcLFTA=; b=GqVx1a6e1Bma1v9Xw0r3T73MKMsJgd6E2YEn41TCy5YBl8Dw8EoJohp4zLu68hqXoO Yr+WPB1Gswi/WZFJnUMDz6OL+Q1um0eeaPZinYmg/qdZPIPa36r8Mf3MvW7bIFWpg2Kj DPZq4Nb7oAUh2TRIyYv2F/J+PJNgZ/GqC2l4akhX2l1a/uQx3xK7aTim297kjJKoxsaw LERw5F0E6kpiVYswSULcs84qgh7HFlCmIqc1oDPZZbiXrtce77E/gp/M3CDEHhwHmmN2 cWC2n0L48PVbPs16NXQaZBMdMqMGI/kkc9UCV4UvuLfoGMU8ltbpsYVee0UeXiUkT4KE nSWA== X-Gm-Message-State: AOAM532kDyKhSEB0KNY0DdDuil+xRSOEgQicdIpSUZTWAykjxnePU8P7 KtaBZJc8VG7M0VYegWo5LB6Uog== X-Google-Smtp-Source: ABdhPJyacCCk/0B3/A+JLg/+8wPu53mnLJAoDOrwOpzG2r9MaK2Ij3/qRcsl8dNtna8kEzO+u/jVvA== X-Received: by 2002:a1c:f616:: with SMTP id w22mr6837124wmc.44.1595399349155; Tue, 21 Jul 2020 23:29:09 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 03/12] semihosting: don't send the trailing '\0' Date: Wed, 22 Jul 2020 07:28:53 +0100 Message-Id: <20200722062902.24509-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200722062902.24509-1-alex.bennee@linaro.org> References: <20200722062902.24509-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, berrange@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , KONRAD Frederic , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: KONRAD Frederic Don't send the trailing 0 from the string. Signed-off-by: KONRAD Frederic Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <1592215252-26742-2-git-send-email-frederic.konrad@adacore.com> Message-Id: <20200717105139.25293-4-alex.bennee@linaro.org> --- 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 22e7827824a..9b4fee92602 100644 --- a/hw/semihosting/console.c +++ b/hw/semihosting/console.c @@ -52,7 +52,9 @@ static GString *copy_user_string(CPUArchState *env, targe= t_ulong addr) =20 do { if (cpu_memory_rw_debug(cpu, addr++, &c, 1, 0) =3D=3D 0) { - s =3D g_string_append_c(s, c); + if (c) { + s =3D g_string_append_c(s, c); + } } else { qemu_log_mask(LOG_GUEST_ERROR, "%s: passed inaccessible address " TARGET_FMT_lx, --=20 2.20.1