File: 0011-null-char.patch

package info (click to toggle)
tayga 0.9.2-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 768 kB
  • sloc: ansic: 7,135; sh: 1,234; makefile: 18
file content (36 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (2)
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
From: "Barak A. Pearlmutter" <barak+git@pearlmutter.net>
Date: Tue, 19 Feb 2019 12:06:01 +0000
Subject: Null char is not the same as NULL

conffile.c:225:12: warning: assignment to `char' from `void *' makes integer from pointer without a cast [-Wint-conversion]
   slash[0] = NULL;
            ^
conffile.c:240:12: warning: assignment to `char' from `void *' makes integer from pointer without a cast [-Wint-conversion]
   slash[0] = NULL;
            ^
---
 conffile.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/conffile.c b/conffile.c
index dd4193c..0406cfd 100644
--- a/conffile.c
+++ b/conffile.c
@@ -222,7 +222,7 @@ static void config_map(int ln, int arg_count, char **args)
 	unsigned int prefix4 = 32;
 	if (slash) {
 		prefix4 = atoi(slash+1);
-		slash[0] = NULL;
+		slash[0] = '\0';
 	}
 
 	if (!inet_pton(AF_INET, args[0], &m->map4.addr)) {
@@ -237,7 +237,7 @@ static void config_map(int ln, int arg_count, char **args)
 	slash = strchr(args[1], '/');
 	if (slash) {
 		prefix6 = atoi(slash+1);
-		slash[0] = NULL;
+		slash[0] = '\0';
 	}
 
 	if ((32 - prefix4) != (128 - prefix6)) {