Browse Source

odhcpd: fix extra compiler warning

src/odhcpd.c:143:2: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
  snprintf(buf, sizeof(buf), sysctl_pattern, ifname, what);
  ^~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Hans Dedecker 3 years ago
parent
commit
405da325b5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/odhcpd.c

+ 2 - 2
src/odhcpd.c

@@ -139,8 +139,8 @@ int main(int argc, char **argv)
 int odhcpd_get_interface_config(const char *ifname, const char *what)
 {
 	char buf[64];
-	const char *sysctl_pattern = "/proc/sys/net/ipv6/conf/%s/%s";
-	snprintf(buf, sizeof(buf), sysctl_pattern, ifname, what);
+	
+	snprintf(buf, sizeof(buf), "/proc/sys/net/ipv6/conf/%s/%s", ifname, what);
 
 	int fd = open(buf, O_RDONLY);
 	if (fd < 0)