Message ID | 20210222224755.50742-4-stokito@gmail.com |
---|---|
State | New |
Headers | show
Return-Path: <openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org> 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=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=BBj8ARFY; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=N8ToCjbG; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4Dky7h4nDdz9sTD for <incoming@patchwork.ozlabs.org>; Tue, 23 Feb 2021 09:50:24 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=n/0nfNKfCtNlKgXlZwTWv2MTGJ6H0gDR/b46EfKLqzY=; b=BBj8ARFYzJM7gq7omauJe2vZ/ uTTHql0znSfjZZKCvqo3QTpp0J+x7IKg1IsZaTLapaESlLIzGPHI77XiDcRniSZCTrNxuL1pfCQsz hv+6CJBGOotiCXWnbEMfrP/0xScSI5YsKPWGoFpXgkrxlgj7uiJq5WfD4XyoRyqAlyyozkOa+ycY7 F6ma88pJ607BmgIRvcDfJS53Vjn4IPms0Yi3yApb/cAYRmAtfM+NQoPNpH02yfki1c/CbWLK3R6JC wKkcZRvVBWy7Yq08uecdjCC+tvYhDqtmuu00vZnJUfj3QwlWf2BbVbUgFTN9ESeTWFCPWfOCYa7cx eG+tUMrYA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEK0J-0000OQ-T1; Mon, 22 Feb 2021 22:48:35 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEK0B-0000L8-L6 for openwrt-devel@lists.openwrt.org; Mon, 22 Feb 2021 22:48:28 +0000 Received: by mail-ej1-x62a.google.com with SMTP id r17so5445486ejy.13 for <openwrt-devel@lists.openwrt.org>; Mon, 22 Feb 2021 14:48:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qjUnaH6cp3K9DGUQs8JJpYlQw0wUHwhIJ3232HGxhu8=; b=N8ToCjbG/mOGYpVK4KWtYZzS33ZfpSmL67oZYqEJax0WsmJ2P3qf8XzjSV+llepp6+ OOtis0/rF+lPG7Db4NZz23BNxNa/KQTvphRFVu1rH90IsZ+ITbIJ+GUmpN4ZD7hypo3b I+Z3LSJMfHo4ZgYDCso+FZZvrfS0RLLamR9dcvDMq55Y2hJH+bmZN15VRoYCuQt9jVoI ayDvhJGWtuEm70fTd4F3Z5gV5uNqKvooNwMbiwzH59Xbl2+aMDvpHbEhGVjYuhgCLVHE NSWDXV5NzGyhwkOpYfNrzJoN0e6gxKOCV8QF7uHsnj8zAbCsnaHPFXutEEwuLOeu8fk0 mo3g== 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=qjUnaH6cp3K9DGUQs8JJpYlQw0wUHwhIJ3232HGxhu8=; b=hERcGziYtgWfn0LwdP3FCccowfLSusJlws26P//04rRvawYComncOveisPtJksaIep niSSPfRSpJX6F6oV/79iV2rtWhKdjYX3bn299T70xAscSSjMSR5zrs8PHpDuzR+LZvhL EpPoCWlTFkmEs1j120KaYAuld73NX3+mL1CBcxQXssdHl1KYh3gkMFv37+rfz2GPz2/Y 7VzrDY2VyShXFBKO0s7pUti3PO2zKPSAdnDReYWWTvqnOP3xkZVJtLLTTPfZqQIsjcu/ 6EVlnca6U3cvnUm2w5CNQpoZKNU46UOTpjHBFIpOCtC2QnrZDqKbr2+zcOlkG+3ft3vK FGYA== X-Gm-Message-State: AOAM531M0vNU2EFQWXmqrPCN5LM8wA4idmbnOjnZ7/a19qGDWdirX4xi Z5o0uEOk2RRq5oUxS3hFjvcjIr29aBmLig== X-Google-Smtp-Source: ABdhPJxtfByRaXb5fMPt9rdKKPV6tlMCyOeEyX5931F9CuvJxYAg2Ka7lJfgeGxT6i93+Hdkycv5Yg== X-Received: by 2002:a17:906:c82e:: with SMTP id dd14mr11580398ejb.102.1614034106093; Mon, 22 Feb 2021 14:48:26 -0800 (PST) Received: from localhost.localdomain ([46.98.213.245]) by smtp.gmail.com with ESMTPSA id bn2sm11437918ejb.35.2021.02.22.14.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Feb 2021 14:48:25 -0800 (PST) From: Sergey Ponomarev <stokito@gmail.com> To: openwrt-devel@lists.openwrt.org Subject: [PATCH 3/3] jshn.c: write_key_string(): extract var Date: Tue, 23 Feb 2021 00:47:55 +0200 Message-Id: <20210222224755.50742-4-stokito@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210222224755.50742-1-stokito@gmail.com> References: <20210222224755.50742-1-stokito@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210222_174827_749526_8DE030B9 X-CRM114-Status: GOOD ( 11.65 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [stokito[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:62a listed in] [list.dnswl.org] X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List <openwrt-devel.lists.openwrt.org> List-Unsubscribe: <https://lists.openwrt.org/mailman/options/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe> List-Archive: <http://lists.openwrt.org/pipermail/openwrt-devel/> List-Post: <mailto:openwrt-devel@lists.openwrt.org> List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help> List-Subscribe: <https://lists.openwrt.org/mailman/listinfo/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe> Cc: Sergey Ponomarev <stokito@gmail.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org> Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org |
Series |
jshn: load envs only on formatting
|
expand
|
diff --git a/jshn.c b/jshn.c index 8fdd290..7a2f935 100644 --- a/jshn.c +++ b/jshn.c @@ -96,8 +96,10 @@ static void add_json_string(const char *str) static void write_key_string(const char *key) { - while (*key) { - putc(isalnum(*key) ? *key : '_', stdout); + char k; + while ((k = *key)) { + k = isalnum(k) ? k : '_'; + putc(k, stdout); key++; } }
This makes code cleaner and helps compiler to optimize Signed-off-by: Sergey Ponomarev <stokito@gmail.com> --- jshn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)