From patchwork Tue Feb 23 13:36:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ponomarev X-Patchwork-Id: 1443490 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=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) 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=iqE0kVDL; 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=OJpJFgG3; 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 4DlKrW59F4z9sSC for ; Wed, 24 Feb 2021 00:38:35 +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=jdRHDvuDqXMxUC/tkK+Lz4RBlJgaCzbJ0yTidAiqRV0=; b=iqE0kVDL/WV0mDp+6yxGZ00Py LpsY2ATLvodQqpq5OM9o4cWfl6VBQpbK51rzex9AAmK5K+njo0hK2U0nueTa07+AzefGJs47fodYt prrkoqYK+rQNZ0XDGNkHK1bbDOrdV5Rxa9JIfiq7OAMnoYvJbG51mooW7krlvSgo37xUbRUpDiEO0 T/BNA8UDoPR1DVAmI0iYSFLyoBpaO6nIF3gia57G+XKtRJPYrb4DEQqPSIHs9vQcoQ+sKnXb+gI+v Oy77ckvFXPYFPQT+rW5tZ8Epn49P2PG1UeTKuYo0p+OoZAseEvQkh00LJupzF2U3CKV6eYtM1K6s8 HQLNS79FQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEXsB-0008D3-W8; Tue, 23 Feb 2021 13:37:08 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEXs9-0008C6-SB for openwrt-devel@lists.openwrt.org; Tue, 23 Feb 2021 13:37:06 +0000 Received: by mail-ej1-x636.google.com with SMTP id n20so8627232ejb.5 for ; Tue, 23 Feb 2021 05:37:05 -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=uh2oq0zfVY4mkO430U+d+xFXaOxszsznN/FoDfRnWIc=; b=OJpJFgG3B02Z94VgBSzNldoKtuILtNTYxq9Gjl+bMoBWikFKlW1V/gSD3tjTg4ZdNA pl6G4sY6x1ZBaQXyOfYNs9HWINgT5AM7yWM5tEnSzBiz37SLVulw93+7ea2bhUFAb+rZ zAecEIz0AO/SUxAfAWuevWPI/X83Dcpap4/Lp74+VEDXJONaVubH+B2PmDTcjC9I0pZ1 vqfVqZOBDu2+xluozcc1NO3Qb0gvPG0Ak3Knr0D4UlHvpkXaG1/wGgxR0EoTDjh/cMRu y1ATk0S1Nm8OJXr6dtbDEhYCqIvgminkL4JP0nsOQuuuPu2enOU+tPFvNi8O+ggKPu2n YxDg== 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=uh2oq0zfVY4mkO430U+d+xFXaOxszsznN/FoDfRnWIc=; b=HhOSJe1Bht8FJ56KsmedMmldD5Yg/20NZXttbBhAjP3E+c/Ntd/WYnBSJQBdty+rDE SlHx47NALTDDtvd7RFH9ncgTggbyTR4hcqTt0pOtXR14TmUpxE+vf1HUy+mDnzLvjyBa stsRpnBcKMyYazPSgv0ivf3e3iB2vD9AqF6RQDNig36iWJASrVVM9Lem8IaFm/meGucc lZY9g6zY9RFoRA9LoTAMDkEymWfehUW+Ii31IThoUMdqV+lXtgRt2uwlmnk+8uQlA+Yd occoOXyg1IHY9eHAUmM9JO5TRsCqvlmcwhBTqJ8d+O0raC56Prrmi10JWcw/oKsgPsHO 6bxw== X-Gm-Message-State: AOAM531WBIlrjHQ4WbscNghL7oszaCVFOGkCCD/v+iLQn8bj37bHlyaq 07kt1LFjG+LIseMbk7o5EC5Lmfn0jQFC2w== X-Google-Smtp-Source: ABdhPJxP4xL+wMxPiy2LxUdVLizV2eAoLcupcw6ywkfC8yKH3mFc1yzrU2I8SHG5goFUAYEuAtyTbA== X-Received: by 2002:a17:906:d147:: with SMTP id br7mr14451927ejb.66.1614087424008; Tue, 23 Feb 2021 05:37:04 -0800 (PST) Received: from localhost.localdomain ([46.98.213.245]) by smtp.gmail.com with ESMTPSA id h10sm15033616edk.45.2021.02.23.05.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 05:37:03 -0800 (PST) From: Sergey Ponomarev To: openwrt-devel@lists.openwrt.org Subject: [PATCH 4/6] jshn.c: use size_t instead of int Date: Tue, 23 Feb 2021 15:36:56 +0200 Message-Id: <20210223133658.19741-1-stokito@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210222224755.50742-1-stokito%40gmail.com> References: <20210222224755.50742-1-stokito%40gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210223_083705_950443_71E28026 X-CRM114-Status: GOOD ( 13.56 ) 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:636 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [stokito[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sergey Ponomarev Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This fixes Clang-Tidy warnings Signed-off-by: Sergey Ponomarev --- jshn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jshn.c b/jshn.c index 7a2f935..43a82e0 100644 --- a/jshn.c +++ b/jshn.c @@ -36,7 +36,7 @@ static struct avl_tree env_vars; static struct blob_buf b = { 0 }; static const char *var_prefix = ""; -static int var_prefix_len = 0; +static size_t var_prefix_len = 0; static int add_json_element(const char *key, json_object *obj); @@ -62,11 +62,11 @@ static int add_json_object(json_object *obj) static int add_json_array(struct array_list *a) { char seq[12]; - int i, len; + size_t i, len; int ret; for (i = 0, len = array_list_length(a); i < len; i++) { - snprintf(seq, sizeof(seq), "%d", i); + snprintf(seq, sizeof(seq), "%zu", i); ret = add_json_element(seq, array_list_get_idx(a, i)); if (ret) return ret; @@ -78,7 +78,7 @@ static int add_json_array(struct array_list *a) static void add_json_string(const char *str) { char *ptr = (char *) str; - int len; + size_t len; char *c; while ((c = strchr(ptr, '\'')) != NULL) { From patchwork Tue Feb 23 13:36:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ponomarev X-Patchwork-Id: 1443492 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=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) 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=nYq1Ribu; 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=GO/eka7X; 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 4DlKrX3f3rz9sW2 for ; Wed, 24 Feb 2021 00:38:36 +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=fNt7asuAjo5SdowP3yJDrvxwIfEJ7jqjtUP457wDTHw=; b=nYq1RibuxPGSRoM3ZYigCLKWr 8dZ+jaeHIzJGJxWmXccDL1zw1L6Oi/K1RqRS/05G6k06ZjtjpUqs1LS4IbVJfpzZ6F3A0oe8Zrb+e 8pR5eh4te5CZSCgm/Cx4EbvM7DxoTKBSpZe495XrLUe+UUDnPH1/meYkrxJmgzqf50MoC5YLK/wdG Hxolm7b7Vv5w0zFQhjxGkNbJ2qc3lWIZvT2ERZgbpWB5s0jBTWP8JKB9BhcC1S8hVUWscOFhvfc0H grdpK3hllVVqTjjWlBv5JdVaQxMwQGcyluZ3J6udav70XGSOKxvHogI1c6g5r+pjJ26gbId4YgV7q icjU+Zr5Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEXsD-0008DQ-MI; Tue, 23 Feb 2021 13:37:09 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEXsA-0008C9-O6 for openwrt-devel@lists.openwrt.org; Tue, 23 Feb 2021 13:37:07 +0000 Received: by mail-ej1-x62b.google.com with SMTP id j6so7494955eja.12 for ; Tue, 23 Feb 2021 05:37:06 -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=sHjSnGUU6a+o6Iek4l5a35F0+euf8qQ23SCd7GONg+8=; b=GO/eka7XKUoqPFkUtLyfwdAYNQk9EVQJ+Ks78h+ZyOgxJC1DrY40/vV4MjswfyI/YM eHCEVGkRLZg9yvWFRUQvnHGBANVfB8ZFaoAL6OTMzKGRyjmRy9caF3gzwcfYKxP/sUPL 0tbAFKUUqhPySLSfZG433zp1A2H05lR5PzUvIwXpzlxXelkOrFkY9h5+z4JvjixkbUnv nMg9n4E6Z0NeT77lNv4L7NckvJ6CRZQOkbfi/bZ/oLGzRnWPVonJgz/wcrtIAMJ456Mv RP6d3m6xnohcUO/xjYpzF68z3RqvYmP2AoAT/KphPthjpBhw0oTSM+KiBkmfbZCEHIHQ FmHg== 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=sHjSnGUU6a+o6Iek4l5a35F0+euf8qQ23SCd7GONg+8=; b=ipbMHtTN//jt+VBORsgsysZGxRIC0YW+M5kH8s8PCBUoCecQMVNFt4PU3owJ3jvfk0 kUAqDcLuUXu5jJScjjyqK6C4zGf3G8Ejk+UAveX+UGI9P5KVN2DEDgOr22cE2TxZNsLo GngvJSIYfM8BAknvIhXIo5TzwdN4WHvQU+U/5kSo71t5Koaqns3HjQ5YVqhBar2C2cD2 bdWkwtHxYQ6vk8gzhLCFA11+xAG3K0bx7DLMSQanQR5blB//r5VTS/DvJ9OmUkyzJxGL FbPb7mAvN5ZiMFjE245+ITx0gN84TaP48wfVgW+wtc9EJHPSdx6UgQqJ0jIwGabJS+tP 5t+g== X-Gm-Message-State: AOAM532azBcsxg+Up+Q2g73CAfEPYt5MkOmvVzH5i/d6S9N6E/Wug1Kr MMpJjYMdihWS+b3FFv3DTqxBS/EkwBy3Tw== X-Google-Smtp-Source: ABdhPJxs/33TlR8q2Qca3AZJ9bQfquh1UU/Y9U4LU9nNmefnrieQWZiedGCfSYZeBtPW8RGzkh89ig== X-Received: by 2002:a17:906:af10:: with SMTP id lx16mr26700703ejb.192.1614087424930; Tue, 23 Feb 2021 05:37:04 -0800 (PST) Received: from localhost.localdomain ([46.98.213.245]) by smtp.gmail.com with ESMTPSA id h10sm15033616edk.45.2021.02.23.05.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 05:37:04 -0800 (PST) From: Sergey Ponomarev To: openwrt-devel@lists.openwrt.org Subject: [PATCH 5/6] jshn.c: add_json_element(): Date: Tue, 23 Feb 2021 15:36:57 +0200 Message-Id: <20210223133658.19741-2-stokito@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210223133658.19741-1-stokito@gmail.com> References: <20210222224755.50742-1-stokito%40gmail.com> <20210223133658.19741-1-stokito@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210223_083706_808180_24C1961C X-CRM114-Status: GOOD ( 11.03 ) 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:62b listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [stokito[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sergey Ponomarev Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Extract variable to store json_object_get_type() Replace switch with json_type_to_name() Signed-off-by: Sergey Ponomarev --- jshn.c | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/jshn.c b/jshn.c index 43a82e0..6490fbc 100644 --- a/jshn.c +++ b/jshn.c @@ -106,38 +106,14 @@ static void write_key_string(const char *key) static int add_json_element(const char *key, json_object *obj) { - char *type; + enum json_type obj_json_type; - switch (json_object_get_type(obj)) { - case json_type_object: - type = "object"; - break; - case json_type_array: - type = "array"; - break; - case json_type_string: - type = "string"; - break; - case json_type_boolean: - type = "boolean"; - break; - case json_type_int: - type = "int"; - break; - case json_type_double: - type = "double"; - break; - case json_type_null: - type = "null"; - break; - default: - return -1; - } + obj_json_type = json_object_get_type(obj); - fprintf(stdout, "json_add_%s '", type); + fprintf(stdout, "json_add_%s '", json_type_to_name(obj_json_type)); write_key_string(key); - switch (json_object_get_type(obj)) { + switch (obj_json_type) { case json_type_object: fprintf(stdout, "';\n"); add_json_object(obj); From patchwork Tue Feb 23 13:36:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ponomarev X-Patchwork-Id: 1443491 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=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) 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=kCHdzE2n; 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=ny3P0rsd; 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 4DlKrW5MMSz9sVr for ; Wed, 24 Feb 2021 00:38:35 +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=i2/uZFe8hbkOghKucpXsjSgAaTXOlzcpJTR4S8Wxfb8=; b=kCHdzE2nf3+wK4cmDsBuF0tUu bXTJsV/jT9ppfTvlKoCd55czYiv+m/qAdGeiOBBVKvTGBQDi02+loGoXLdcAj7ST2oIpACyDcwPAM tpFC7xLQdBdAE08vyvQVV2bVf6CvrN3pQfXEugMQEcPpNqvtiI963Pc/Bx3qWlxyD28GuEgbzWdb4 FzvxxJUYOZA51QLAlDcaLyzl0+7krT1bRGRe5Sz58IF0zMXhK+U0z+ZaZHvG3cgQay+LgIAxB0Tr3 IqNoWpJbD37nDIX2rhRsM1LOYT8jOFRYsaP7+HJwRVuCtTcW5RdpSFWiIrbpaVlwzIAhaKvL6+qw5 KKAfZS4lw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEXsF-0008De-C1; Tue, 23 Feb 2021 13:37:11 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEXsB-0008CQ-Dx for openwrt-devel@lists.openwrt.org; Tue, 23 Feb 2021 13:37:08 +0000 Received: by mail-ej1-x634.google.com with SMTP id hs11so34651507ejc.1 for ; Tue, 23 Feb 2021 05:37:06 -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=Gzoeo+GpfSx9H+8Ip44l4pb+GxLaFjVp+ZhvecRkfGo=; b=ny3P0rsdcoTthjf09+JHFp9SwJj6QcIiWAnG1GXDUWkwofAx02ED2PhpGjUjWZqAKf 1JDEEkTJOajaLpcSLR7bNIx1LWcyYAYZD2yV0tCFU7k8VLQODJWLf9XR2gVt+iwatltz Rb07+d4WMfWgU0CBmJy0SF5KzeCKL3xvDKmcMfJHv4SeaymIrSgxLSV8NGpdP8nqKLjD Xy7YcOsnYbsj12EWytE7c+D1kPoI1cdiXD+Ty1VFWWZ7klJl2RKad9dPaH3OLkfrharm WfSRui9eVtfCWbrpjSbpLjpx3KMksgNZE2g+qTcaWnOv3DeA6CRRZIh6E3kNZq6AyMwi SPDQ== 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=Gzoeo+GpfSx9H+8Ip44l4pb+GxLaFjVp+ZhvecRkfGo=; b=pI5+lkRYumg5j/N9z3kl7mnjcciQ2nd4OEyksmPNy2DzRR6I5hWJtshfCTQSKQkrsF 4Xfd3YaTxSsM4cxUQ3BDAIXXidz2CPvgUkkbpVX635GbvrQY4aFt5LGVf3WcUzNW/ewz nzptB7UPVCJ38CmYaeNGHV4PwdpHxBxQRNmhS4oxzcftN9wr9vvHnN9Q/xgGbXsldDv3 XXHS9qS/srSVoXPawkw8EhWQfOpViAiZOsHdnmVLfpRyS4IaFZ22Ph78eBGB3VJqB2+2 UcoSpXdTYZfcJP26h4lM2CfHj7E7E/03b0Q+KFPslCNuyKUJr2M4VMnoOLDRGTbNd9fz wGOQ== X-Gm-Message-State: AOAM533/hIjULtdzKVEmmIqv0+SGKNDbYe/aKzTOz5XfwZ6Jb2POj9f7 xiSdRVegnv8OAQy9XCz0noL/p7KT2Hdijg== X-Google-Smtp-Source: ABdhPJzIlAp211bKTt3BHMHJcK/RCubWKBF22pSYUe4jkzO0SXTISejHojiVKL9PQhPf7SrJNU5DeQ== X-Received: by 2002:a17:907:7672:: with SMTP id kk18mr11807225ejc.514.1614087425733; Tue, 23 Feb 2021 05:37:05 -0800 (PST) Received: from localhost.localdomain ([46.98.213.245]) by smtp.gmail.com with ESMTPSA id h10sm15033616edk.45.2021.02.23.05.37.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 05:37:05 -0800 (PST) From: Sergey Ponomarev To: openwrt-devel@lists.openwrt.org Subject: [PATCH 6/6] jshn.c: getenv_avl(): var->val is always not NULL Date: Tue, 23 Feb 2021 15:36:58 +0200 Message-Id: <20210223133658.19741-3-stokito@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210223133658.19741-1-stokito@gmail.com> References: <20210222224755.50742-1-stokito%40gmail.com> <20210223133658.19741-1-stokito@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210223_083707_501977_C63BF84E X-CRM114-Status: GOOD ( 12.96 ) 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_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:634 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sergey Ponomarev Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Sergey Ponomarev --- jshn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jshn.c b/jshn.c index 6490fbc..979182f 100644 --- a/jshn.c +++ b/jshn.c @@ -170,7 +170,7 @@ static int jshn_parse(const char *str) static char *getenv_avl(const char *key) { struct env_var *var = avl_find_element(&env_vars, key, var, avl); - return var ? var->val : NULL; + return var->val; } static char *get_keys(const char *prefix)