aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-02-28 12:40:14 +0100
committerBrian Behlendorf <[email protected]>2022-05-12 09:25:31 -0700
commit5f0c1c4ebd3ed1148a57ecdfeafce9b3adadc0d8 (patch)
tree174be12ad282ac290e781c3071de2bc0308e4642 /lib
parent45588be2851b16add95883e3a7f0f6bdb9393f97 (diff)
freebsd: libshare/nfs: constify static const data
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13165
Diffstat (limited to 'lib')
-rw-r--r--lib/libshare/os/freebsd/nfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libshare/os/freebsd/nfs.c b/lib/libshare/os/freebsd/nfs.c
index ea02dc1ba..0edddf93e 100644
--- a/lib/libshare/os/freebsd/nfs.c
+++ b/lib/libshare/os/freebsd/nfs.c
@@ -78,9 +78,9 @@ static sa_fstype_t *nfs_fstype;
static char *
translate_opts(const char *shareopts)
{
- static const char *known_opts[] = { "ro", "maproot", "mapall", "mask",
- "network", "sec", "alldirs", "public", "webnfs", "index", "quiet",
- NULL };
+ static const char *const known_opts[] = { "ro", "maproot", "mapall",
+ "mask", "network", "sec", "alldirs", "public", "webnfs", "index",
+ "quiet" };
static char newopts[OPTSSIZE];
char oldopts[OPTSSIZE];
char *o, *s = NULL;
@@ -93,7 +93,7 @@ translate_opts(const char *shareopts)
while ((o = strsep(&s, "-, ")) != NULL) {
if (o[0] == '\0')
continue;
- for (i = 0; known_opts[i] != NULL; i++) {
+ for (i = 0; i < ARRAY_SIZE(known_opts); ++i) {
len = strlen(known_opts[i]);
if (strncmp(known_opts[i], o, len) == 0 &&
(o[len] == '\0' || o[len] == '=')) {