From patchwork Fri Nov 29 21:06:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1202601 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SLXn3zQi"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rGGVSsWR"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47PnBF0P2Mz9sPT for ; Sat, 30 Nov 2019 08:06:44 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=55sehMsUnnERmbQ7i/g6mLuTw6MQD5U+I87yWJO74as=; b=SLXn3zQiIzAuYL uikTDHODJz22XagBwm3nfzY/yadLqTP7VQI4Mp60mucMd96ZhcjpBR/egHjiyAvCYzRQiU4z/GAtJ 2RQ7+6NpM30esRoQedGc4b+Ifq5qPuuzCjPVkvznDZMRieV7WkXRNeCHHknBDBpXtSzUlT7fm3I1n HgguzRLcGxQtK6NeEuBDha2wUv5L/tJTjF7JYqqIL/zWYxhpSbQZqmjjS7yGGHRdzrvkZAdCupjMh UUE9D/yreArHGD6wMCacbUoPCsBTu8H/IR/RZ+XSBh2ZbNTn+51IfpPFkZHz+S+7JWt8lWDq9I3EP qD7mF089/oCl4mZdTizg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ianTN-0005Eh-An; Fri, 29 Nov 2019 21:06:41 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ianTK-0005Dh-BK for openwrt-devel@lists.openwrt.org; Fri, 29 Nov 2019 21:06:39 +0000 Received: by mail-pf1-x443.google.com with SMTP id x28so15182529pfo.6 for ; Fri, 29 Nov 2019 13:06:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=pZQ8tpzkka7xFFgLloTGhwHDmAefv2mNcF8vdCzLKNM=; b=rGGVSsWR9/ObxPGDJJGhggDd+KaGxx93G+q2cP9oMkl6vZiSfzGDv2zqnl3FNizlf0 xGcad12GTYM8ISjB4F9MhJvs05NoV81Dajd/YsZQQzGSGH8VqRkfGDpJp25ObgvlKi79 pDUgAzE4yVw+D8+bW8oi98PDncCSBhoLRwJL+rf8HBYCaQ+Ckl13+j2rqd6yqCkMBIb3 c68n1RvsG2W3tYwJlyC9ejfmVCmxWA5rsMKN6ynnOEWyrMwp3m/ZEv3/i2NavkG+HxeR cbwZyt0zGCEXAsNkdYsCQKEB8l8zTpQUfUYXTCoe+Ozf7o4io4idixUUgJ93goN/DxVB kgng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=pZQ8tpzkka7xFFgLloTGhwHDmAefv2mNcF8vdCzLKNM=; b=QOYcHaiDXu0z6LDER2I7IYyQwUQfKfcfAqJPQHCQX+i/jJydhXUx13d65DiICATYtp 50uYJB+DMyKF+zDPoLSTX6fdYzhWDW6SGg6L8TB+Ej845H2sUvPPaCytFqtkah4vJJ76 pFDiUdQLHCiYiK6yRVCgl9sZBZzY082qfgJe17KeqrMH+d7PsqTF/wk9prI8gTDwJJ9U PrMXmot4BfrG4FUKMfTa18/9kATTJaI22COmdSGjPH2yb/NV+os/v5VKGsTGIO2pMc/o 9oQ5b94SE33isMIG1PD1rdHtnd4w7B6kBCQJj8GOf9NeT1HvVirV7hcZ3Rd0yqbhModp EZ3Q== X-Gm-Message-State: APjAAAWffq78n3qNwyEg7BkL9UBQBXzKg20PMrczUe7VKou3nwPPBsuU YuV3osQhUDyfQKTzuZKrlO769myO/Oo= X-Google-Smtp-Source: APXvYqyhlpciK87hMjj6Y7rk4IyDmAzzizwxEFRmSYoCsLHO0r7B2hD1kwt8+B9G6RZdUwU8BTzQVg== X-Received: by 2002:a62:1b4b:: with SMTP id b72mr7060278pfb.96.1575061596627; Fri, 29 Nov 2019 13:06:36 -0800 (PST) Received: from localhost.localdomain ([69.42.0.214]) by smtp.gmail.com with ESMTPSA id b98sm15696649pjc.16.2019.11.29.13.06.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2019 13:06:35 -0800 (PST) From: Rosen Penev To: openwrt-devel@lists.openwrt.org Date: Fri, 29 Nov 2019 13:06:34 -0800 Message-Id: <20191129210634.4066-1-rosenp@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191129_130638_417326_5DBA02AB X-CRM114-Status: UNSURE ( 8.67 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rosenp[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 listed in] [list.dnswl.org] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [OpenWrt-Devel] [PATCH] firewall: Fix Wformat-nonliteral warning X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Allows GCC to check the formats by switching to a define, which is a constant expression. Fixes: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] 207 | snprintf(buf, sizeof(buf), tmpl, include->path); Signed-off-by: Rosen Penev --- includes.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes.c b/includes.c index 23b2244..1e759fb 100644 --- a/includes.c +++ b/includes.c @@ -188,11 +188,11 @@ run_include(struct fw3_include *include) { int rv; struct stat s; - const char *tmpl = - "config() { " - "echo \"You cannot use UCI in firewall includes!\" >&2; " - "exit 1; " - "}; . %s"; + #define tmpl \ + "config() { " \ + "echo \"You cannot use UCI in firewall includes!\" >&2; " \ + "exit 1; " \ + "}; . %s" char buf[PATH_MAX + sizeof(tmpl)];