diff --git a/lib/roken/hstrerror.c b/lib/roken/hstrerror.c index 9b5f49637..666fc92fd 100644 --- a/lib/roken/hstrerror.c +++ b/lib/roken/hstrerror.c @@ -9,7 +9,9 @@ #include #include -static char *msg[] = { +static +const +char *const msg[] = { "No error", "Authoritative Answer Host not found", "Non-Authoritive Host not found, or SERVERFAIL", @@ -17,9 +19,10 @@ static char *msg[] = { "Valid name, no data record of requested type" }; +const char *hstrerror(int herr) { - if(herr >= 0 && herr <= 4) + if (herr >= 0 && herr <= 4) return msg[herr]; return "Error number out of range (hstrerror)"; } diff --git a/lib/roken/roken.h b/lib/roken/roken.h index 0d69ce329..d56a90080 100644 --- a/lib/roken/roken.h +++ b/lib/roken/roken.h @@ -42,7 +42,7 @@ char *strerror(int eno); #endif #ifndef HAVE_HSTRERROR -char *hstrerror(int herr); +const char *hstrerror(int herr); #endif #ifndef HAVE_HERROR diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index 0d69ce329..d56a90080 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -42,7 +42,7 @@ char *strerror(int eno); #endif #ifndef HAVE_HSTRERROR -char *hstrerror(int herr); +const char *hstrerror(int herr); #endif #ifndef HAVE_HERROR