diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2020-12-30 08:53:31 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2020-12-30 08:53:31 +0000 |
commit | 94447ea5c19f983fcb3c14d086c61db53b1d5282 (patch) | |
tree | 744ebf7b92a25e0d3b783b606410f00b110bac17 | |
parent | d578d7a826d0c18ce88c48a6dadb18ecd5e93762 (diff) |
Constify the strings in cnames[]. No functional change.
from miod, ok millert
-rw-r--r-- | lib/libc/regex/cname.h | 6 | ||||
-rw-r--r-- | lib/libc/regex/regcomp.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/regex/cname.h b/lib/libc/regex/cname.h index 9cce44e4fc3..667cb54060f 100644 --- a/lib/libc/regex/cname.h +++ b/lib/libc/regex/cname.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cname.h,v 1.5 2003/06/02 20:18:36 millert Exp $ */ +/* $OpenBSD: cname.h,v 1.6 2020/12/30 08:53:30 tb Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. @@ -36,8 +36,8 @@ */ /* character-name table */ -static struct cname { - char *name; +static const struct cname { + const char *name; char code; } cnames[] = { { "NUL", '\0' }, diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index 7396cf1dda5..d6df4d83d83 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: regcomp.c,v 1.35 2020/10/13 04:42:28 guenther Exp $ */ +/* $OpenBSD: regcomp.c,v 1.36 2020/12/30 08:53:30 tb Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. * Copyright (c) 1992, 1993, 1994 @@ -826,7 +826,7 @@ p_b_coll_elem(struct parse *p, int endc) /* name ended by endc,']' */ { char *sp = p->next; - struct cname *cp; + const struct cname *cp; size_t len; while (MORE() && !SEETWO(endc, ']')) |