From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 10 Nov 2025 21:35:49 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vIYc9-00HVOu-1s for lore@lore.pengutronix.de; Mon, 10 Nov 2025 21:35:49 +0100 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vIYc5-0002Jq-QG for lore@pengutronix.de; Mon, 10 Nov 2025 21:35:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=At1u87OYjOnKNX16mPh5o/2eypnAInq+U89iJshBMuY=; b=lOPAstU+FUv9xBNKpkXMMP8wuP gDWn2jPRJM8zYddhRxqKLdYeD6JdO/8qWfhRUSpH+3ImZjw69j8m9tnV4fb7fNQMackg1PXYwNeMr 33YKCDfxhRz6O709UaO4Mj1U0gMiggI6x+kZ9sWwh2PFYAOuYIabqt0iEBegr4ChPTw8SwTLFr5ow QprgHQ+NM29WPmfMUEpKsD6O5FHKdiX4Kj8REq2bM5xjLeFIiY7slW3r28etlT1e/v4nTTNBfgwz4 Rhag3dXiZCVWS6FEA+e/6taeXx0zG7vjFIDSbPWgG3s5/47S/1h72U7oSmtCpUZf0tJpoy7/Ydk8V BDI7E51Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vIYbJ-000000065bu-40qp; Mon, 10 Nov 2025 20:34:57 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vIYbB-000000065SM-2v9y for barebox@lists.infradead.org; Mon, 10 Nov 2025 20:34:53 +0000 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1vIYb8-0001MT-Rn; Mon, 10 Nov 2025 21:34:46 +0100 From: Marco Felsch Date: Mon, 10 Nov 2025 21:34:55 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251110-v2025-09-0-topic-optee-of-handling-v1-15-8f0625ac5471@pengutronix.de> References: <20251110-v2025-09-0-topic-optee-of-handling-v1-0-8f0625ac5471@pengutronix.de> In-Reply-To: <20251110-v2025-09-0-topic-optee-of-handling-v1-0-8f0625ac5471@pengutronix.de> To: Sascha Hauer , BAREBOX Cc: Marco Felsch X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251110_123449_805114_02627F35 X-CRM114-Status: UNSURE ( 7.52 ) X-CRM114-Notice: Please train this message. X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: [PATCH 15/23] pbl: string: add strncmp X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.whiteo.stw.pengutronix.de) Signed-off-by: Marco Felsch --- pbl/string.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pbl/string.c b/pbl/string.c index 528f62ef2055aa59643e7a882b2ac1358813386d..89663fef3d6a5b0bdcbda2f3c6bc686f1ee4da71 100644 --- a/pbl/string.c +++ b/pbl/string.c @@ -102,6 +102,21 @@ int strcmp(const char *cs, const char *ct) return res; } +int strncmp(const char *cs, const char *ct, size_t count) +{ + register signed char __res = 0; + + BUG_ON(!cs || !ct); + + while (count) { + if ((__res = *cs - *ct++) != 0 || !*cs++) + break; + count--; + } + + return __res; +} + int strcasecmp(const char *s1, const char *s2) { int c1, c2; -- 2.47.3