aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-core/safec/safec/0001-strpbrk_s-Remove-unused-variable-len.patch
blob: 4fd36ab8ab2e6b782ef08b6da2750d20b73ddc62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From b1d7cc6495c541cdd99399b4d1a835997376dcbf Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 22 Aug 2022 23:42:33 -0700
Subject: [PATCH] strpbrk_s: Remove unused variable len

Fixes
error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]

Upstream-Status: Submitted [https://github.com/rurban/safeclib/pull/123]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/extstr/strpbrk_s.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/extstr/strpbrk_s.c b/src/extstr/strpbrk_s.c
index 5bb7a0f8..2cf8a8be 100644
--- a/src/extstr/strpbrk_s.c
+++ b/src/extstr/strpbrk_s.c
@@ -79,7 +79,6 @@ EXPORT errno_t _strpbrk_s_chk(char *dest, rsize_t dmax, char *src, rsize_t slen,
 #endif
 {
     char *ps;
-    rsize_t len;
 
     CHK_SRC_NULL("strpbrk_s", firstp)
     *firstp = NULL;
@@ -121,7 +120,6 @@ EXPORT errno_t _strpbrk_s_chk(char *dest, rsize_t dmax, char *src, rsize_t slen,
     while (*dest && dmax) {
 
         ps = src;
-        len = slen;
         while (*ps) {
 
             /* check for a match with the substring */
@@ -130,7 +128,6 @@ EXPORT errno_t _strpbrk_s_chk(char *dest, rsize_t dmax, char *src, rsize_t slen,
                 return RCNEGATE(EOK);
             }
             ps++;
-            len--;
         }
         dest++;
         dmax--;