aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch
blob: f21c68f0d11962b1aa4ffe8b32f9a70a60a2a8e7 (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
From cf25576428903168cd41b183fb1ca9c2b7e2666e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 26 Aug 2017 07:28:10 -0700
Subject: [PATCH 2/3] Mark first element of a string as null

Fixes
cli_lib.c:427:20: error: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Werror,-Wnon-literal-null-conversion]
                                        values[arg] = '\0';
                                                      ^~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending

 cli/cli_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cli/cli_lib.c b/cli/cli_lib.c
index 41a0b06..e4d2fd5 100644
--- a/cli/cli_lib.c
+++ b/cli/cli_lib.c
@@ -424,7 +424,7 @@ int cli_find_args(int argc, char *argv[], struct cli_node *cmd, struct cli_node
 			if (arg_string[1] == '\0') {
 				/* no arg value - only allowed for string args */
 				if (node->arg->parser == cli_arg_parse_string) {
-					values[arg] = '\0';
+					*values[arg] = '\0';
 				} else {
 					result = -EINVAL;
 					break;
-- 
2.14.1