From nobody Sun Dec 14 21:49:39 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570110822; cv=none; d=zoho.com; s=zohoarc; b=ZHBR8v29eWRpaDOZjOktkrDdEsAOqcEjYv9bYlX4sdextSSCtwfrhb1Z+G4KjlVZ0veCkwpTYnn84+HkUm20OO3u8pwfvHkZqfKf+Kee6iVahGkWgmG4hqbduy9C9RRTNco+EBascpLYCigJKqz0lsBFtoem8/E3yr4nYW2eeA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570110822; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=XWvfNr3B/gBIcmLMVygXJIN5ozDuCYx9fDMsRMDeXTQ=; b=KGR2c46CA8UoYW4LQ1w6zzk24FbJvtVG/szkOOrV2zC2uQ9Sif5+xN5gOYFb8VbJVS6AihJ5KJ6N0NUesqsFyLJWE7gpBg2FtZde52+o+SbYOjuLEBMChjpvuO37TNQnbpYhMUuZxLTctq6f1QfrHU7oP+R/o9U7UvJbHJzlAXk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570110822170918.0366187034004; Thu, 3 Oct 2019 06:53:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A8653078A3A; Thu, 3 Oct 2019 13:53:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC53760468; Thu, 3 Oct 2019 13:53:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AF775180B761; Thu, 3 Oct 2019 13:53:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93DrRrk019896 for ; Thu, 3 Oct 2019 09:53:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 92F68608A5; Thu, 3 Oct 2019 13:53:27 +0000 (UTC) Received: from dhcp-17-55.lcy.redhat.com (unknown [10.42.17.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F83E6092F; Thu, 3 Oct 2019 13:53:26 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 14:53:12 +0100 Message-Id: <20191003135318.19149-6-berrange@redhat.com> In-Reply-To: <20191003135318.19149-1-berrange@redhat.com> References: <20191003135318.19149-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/11] util: drop the stpcpy gnulib module X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 03 Oct 2019 13:53:40 +0000 (UTC) stpcpy returns a pointer to the end of the string just copied which in theory makes it easier to then copy another string after it. We only use stpcpy in one place though and that is trivially rewritten to avoid stpcpy with no less in code clarity or efficiency. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: J=C3=A1n Tomko --- bootstrap.conf | 1 - src/util/virerror.c | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 9964231bb7..9ca1e6ddd7 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -96,7 +96,6 @@ snprintf socket stat-time stdarg -stpcpy strchrnul strdup-posix strndup diff --git a/src/util/virerror.c b/src/util/virerror.c index 77f76a9abf..3bb9d1d32c 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -1367,8 +1367,9 @@ void virReportSystemErrorFull(int domcode, =20 size_t len =3D strlen(errnoDetail); if (0 <=3D n && n + 2 + len < sizeof(msgDetailBuf)) { - char *p =3D msgDetailBuf + n; - stpcpy(stpcpy(p, ": "), errnoDetail); + strcpy(msgDetailBuf + n, ": "); + n +=3D 2; + strcpy(msgDetailBuf + n, errnoDetail); msgDetail =3D msgDetailBuf; } } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list