summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex/regerror.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2017-05-07 01:31:42 +0000
committerpfg <pfg@FreeBSD.org>2017-05-07 01:31:42 +0000
commit7a027d3bd08849589328b2a085d33dea2874465a (patch)
tree4057c07ffd45d6fea0e1912c8f19500125498605 /lib/libc/regex/regerror.c
parentcca5af1b9cc197e4953c52bd73cf0d77e87c7484 (diff)
downloadFreeBSD-src-7a027d3bd08849589328b2a085d33dea2874465a.zip
FreeBSD-src-7a027d3bd08849589328b2a085d33dea2874465a.tar.gz
MFC r317346:
regex: unsign and constify some variables. Taking some hints from the regex variant in nvi(1) and higher-level compiler warnings, update some types in our regex(3) implementation. Joint work with: Kyle Evans
Diffstat (limited to 'lib/libc/regex/regerror.c')
-rw-r--r--lib/libc/regex/regerror.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/regex/regerror.c b/lib/libc/regex/regerror.c
index b9b773c..508c7d5 100644
--- a/lib/libc/regex/regerror.c
+++ b/lib/libc/regex/regerror.c
@@ -54,7 +54,7 @@ extern "C" {
#endif
/* === regerror.c === */
-static char *regatoi(const regex_t *preg, char *localbuf);
+static const char *regatoi(const regex_t *preg, char *localbuf);
#ifdef __cplusplus
}
@@ -83,8 +83,8 @@ static char *regatoi(const regex_t *preg, char *localbuf);
*/
static struct rerr {
int code;
- char *name;
- char *explain;
+ const char *name;
+ const char *explain;
} rerrs[] = {
{REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"},
{REG_BADPAT, "REG_BADPAT", "invalid regular expression"},
@@ -120,7 +120,7 @@ regerror(int errcode,
struct rerr *r;
size_t len;
int target = errcode &~ REG_ITOA;
- char *s;
+ const char *s;
char convbuf[50];
if (errcode == REG_ATOI)
@@ -158,7 +158,7 @@ regerror(int errcode,
- regatoi - internal routine to implement REG_ATOI
== static char *regatoi(const regex_t *preg, char *localbuf);
*/
-static char *
+static const char *
regatoi(const regex_t *preg, char *localbuf)
{
struct rerr *r;
OpenPOWER on IntegriCloud