From c3abc6ba6f322b7108220875a3bb21c7bb819450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Groenvall?= Date: Wed, 7 Aug 1996 20:06:58 +0000 Subject: [PATCH] Added const to hstrerror. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@637 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/hstrerror.c | 7 +++++-- lib/roken/roken.h | 2 +- lib/roken/roken.h.in | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) 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