Update.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@638 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -11,20 +11,26 @@
|
|||||||
|
|
||||||
static
|
static
|
||||||
const
|
const
|
||||||
char *const msg[] = {
|
char *const h_errlist[] = {
|
||||||
"No error",
|
"Resolver Error 0 (no error)",
|
||||||
"Authoritative Answer Host not found",
|
"Unknown host", /* 1 HOST_NOT_FOUND */
|
||||||
"Non-Authoritive Host not found, or SERVERFAIL",
|
"Host name lookup failure", /* 2 TRY_AGAIN */
|
||||||
"Non recoverable errors, FORMERR, REFUSED, NOTIMP",
|
"Unknown server error", /* 3 NO_RECOVERY */
|
||||||
"Valid name, no data record of requested type"
|
"No address associated with name", /* 4 NO_ADDRESS */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static
|
||||||
const
|
const
|
||||||
char *hstrerror(int herr)
|
int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] };
|
||||||
|
|
||||||
|
const
|
||||||
|
char *
|
||||||
|
hstrerror(int herr)
|
||||||
{
|
{
|
||||||
if (herr >= 0 && herr <= 4)
|
if (0 <= herr && herr < h_nerr)
|
||||||
return msg[herr];
|
return h_errlist[herr];
|
||||||
return "Error number out of range (hstrerror)";
|
else
|
||||||
|
return "Error number out of range (hstrerror)";
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user