@@ -324,19 +324,14 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
{
int n = __ns_name_unpack (answer->buf, end_of_message, cp,
packtmp, sizeof packtmp);
- if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
- {
- if (errno == EMSGSIZE)
- goto too_small;
-
- n = -1;
- }
-
- if (n > 0 && bp[0] == '.')
- bp[0] = '\0';
-
if (n < 0)
goto bad_message;
+ if (__ns_name_ntop (packtmp, bp, linebuflen) < 0)
+ goto too_small;
+
+ if (bp[0] == '.')
+ bp[0] = '\0';
+
cp += n;
if (end_of_message - cp < 10)
@@ -355,16 +350,11 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
{
n = __ns_name_unpack (answer->buf, end_of_message, cp,
packtmp, sizeof packtmp);
- if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
- {
- if (errno == EMSGSIZE)
- goto too_small;
-
- n = -1;
- }
-
if (n < 0)
goto bad_message;
+ if (__ns_name_ntop (packtmp, bp, linebuflen) < 0)
+ goto too_small;
+
cp += rdatalen;
if (alias_pointer + 2 < &net_data->aliases[MAX_NR_ALIASES])
{