From nobody Mon Feb 9 09:08:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 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=1571752795; cv=none; d=zoho.com; s=zohoarc; b=QmJDyABv6qSTJgIecGIusV0FlTbB1VPk5z7JKGbSp95EKTb8Hjxlt/JkdsLosDGmcRvum7Sq3AoWQHUnTQ+oDOKtE3AdLbbmypOYqnUXZ3zofVExmoTVxEErDrMYB/ARA/dnQo4phRgKpNoVfzWHvUHBrlTpXr/VJ4eKUz05Tao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571752795; 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; bh=gECWNlkZNCPvxl7fEp7eB32Ela4/hRhyL5hVgNzO3JY=; b=CTONLSIkM0BXvLexS+q2NoBXIz1qO/ve9/6dlTijpZh/BV+kYvHQzOLx6KUmlYeKBGgslRC20qAOekbp6UyLnRwK8ztrKrawe0rY3kVUkXYey5zIG6aSYhHzkHbYPWaZkaIGTKha+Z5XPBXc2s5WUr+dHkqZUC4GN/YHPBu/fGo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 157175279525616.594721682285467; Tue, 22 Oct 2019 06:59:55 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-74-kSC5-HmYMCemou8irdBZfQ-1; Tue, 22 Oct 2019 09:59:52 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D6851005525; Tue, 22 Oct 2019 13:59:46 +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 0F60560C63; Tue, 22 Oct 2019 13:59:46 +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 BBC911803518; Tue, 22 Oct 2019 13:59:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9MDxi09002218 for ; Tue, 22 Oct 2019 09:59:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id D302A60167; Tue, 22 Oct 2019 13:59:44 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B8AD60166 for ; Tue, 22 Oct 2019 13:59:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571752794; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=gECWNlkZNCPvxl7fEp7eB32Ela4/hRhyL5hVgNzO3JY=; b=H6ZbsLVoQf0jkdCRP71fLlps+7wMU6O1AECdqeqqXhm12607Mk+KjD6Jd+LlfJSPu4D/GB 3sXawJ3UWgD7qBxcuNp4TV1Nb8iLF+qbDC3CwRV7YLh0L1USXwCKjr1WnFj4be4hRZHcDp zYgPScGUEnwU+2BC/6qyn3hoFiFJ6LE= From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 15:57:38 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 34/75] virstring: Make virAsprintf() return no value 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: kSC5-HmYMCemou8irdBZfQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/util/virstring.c | 11 +++-------- src/util/virstring.h | 5 ++--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/util/virstring.c b/src/util/virstring.c index 24a9e41493..91b237f358 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -746,23 +746,18 @@ virVasprintfInternal(char **strp, return ret; } =20 -int +void virAsprintfInternal(char **strp, const char *fmt, ...) { va_list ap; - char *str =3D NULL; - int ret; =20 va_start(ap, fmt); - ret =3D g_vasprintf(&str, fmt, ap); + g_vasprintf(strp, fmt, ap); va_end(ap); =20 - if (!*str) + if (!*strp) abort(); - *strp =3D str; - - return ret; } =20 /** diff --git a/src/util/virstring.h b/src/util/virstring.h index d7881be2d1..f595d0ad4c 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -133,9 +133,8 @@ int virStrdup(char **dest, const char *src) =20 int virStrndup(char **dest, const char *src, ssize_t n) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1); -int virAsprintfInternal(char **strp, const char *fmt, ...) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_PRINTF(2, 3) - G_GNUC_WARN_UNUSED_RESULT; +void virAsprintfInternal(char **strp, const char *fmt, ...) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_PRINTF(2, 3); int virVasprintfInternal(char **strp, const char *fmt, va_list list) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_PRINTF(2, 0) G_GNUC_WARN_UNUSED_RESULT; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list