From e2e644e9b74271f899e60e72f432fd2b7cd11f2e Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 14 Jan 2014 14:40:36 +0000 Subject: [PATCH] Mark more data as read only. Thanks to Sebastian Huber. --- dhcp.c | 4 ++-- dhcp6.c | 2 +- dhcpcd-embedded.h.in | 2 +- if-options.c | 2 +- script.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dhcp.c b/dhcp.c index ae778d7f..4127b30a 100644 --- a/dhcp.c +++ b/dhcp.c @@ -104,7 +104,7 @@ static const struct dhcp_op dhcp_ops[] = { { 0, NULL } }; -static const char *dhcp_params[] = { +static const char * const dhcp_params[] = { "ip_address", "subnet_cidr", "network_number", @@ -130,7 +130,7 @@ static int dhcp_open(struct interface *); void dhcp_printoptions(void) { - const char **p; + const char * const *p; size_t i; const struct dhcp_opt *opt; diff --git a/dhcp6.c b/dhcp6.c index bcbd3823..8d4a22a3 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -68,7 +68,7 @@ //#define VENDOR_SPLIT static int sock = -1; -static struct in6_addr in6addr_linklocal_alldhcp = +static const struct in6_addr in6addr_linklocal_alldhcp = IN6ADDR_LINKLOCAL_ALLDHCP_INIT; static struct sockaddr_in6 from; static struct msghdr sndhdr; diff --git a/dhcpcd-embedded.h.in b/dhcpcd-embedded.h.in index acce1ebe..ac326bb5 100644 --- a/dhcpcd-embedded.h.in +++ b/dhcpcd-embedded.h.in @@ -28,4 +28,4 @@ #define INITDEFINES @INITDEFINES@ #define INITDEFINE6S @INITDEFINE6S@ -extern const char *dhcpcd_embedded_conf[]; +extern const char * const dhcpcd_embedded_conf[]; diff --git a/if-options.c b/if-options.c index c322d478..06a17a6b 100644 --- a/if-options.c +++ b/if-options.c @@ -1554,7 +1554,7 @@ read_config(const char *file, int skip = 0, have_profile = 0; #ifndef EMBEDDED_CONFIG char *buf; - const char **e; + const char * const *e; size_t buflen, ol; #endif #if !defined(INET) || !defined(INET6) diff --git a/script.c b/script.c index 133a1f6f..86518470 100644 --- a/script.c +++ b/script.c @@ -54,7 +54,7 @@ #define DEFAULT_PATH "PATH=/usr/bin:/usr/sbin:/bin:/sbin" -static const char *if_params[] = { +static const char * const if_params[] = { "interface", "reason", "pid", @@ -70,7 +70,7 @@ static const char *if_params[] = { void if_printoptions(void) { - const char **p; + const char * const *p; for (p = if_params; *p; p++) printf(" - %s\n", *p); -- 2.47.3