summaryrefslogtreecommitdiff
path: root/print-atalk.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-02-25 11:04:39 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-02-25 20:58:27 +0100
commit5ae22f41a8e2152c8618227a0cc45b9de61a0f70 (patch)
treebd2eceb94241bd769a28d0422adb0e073ea140a9 /print-atalk.c
parent7780402e9f67ffe6b98274f16277c8db00d3a95f (diff)
downloadtcpdump-5ae22f41a8e2152c8618227a0cc45b9de61a0f70.tar.gz
Add a status exit code to the function ndo_error()
The status are defined in an enum in status-exit-codes.h. Moreover: Use ndo_error() instead of ndo_warning() for malloc() errors in print-esp.c.
Diffstat (limited to 'print-atalk.c')
-rw-r--r--print-atalk.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/print-atalk.c b/print-atalk.c
index 25a1801a..3cd04177 100644
--- a/print-atalk.c
+++ b/print-atalk.c
@@ -608,8 +608,8 @@ ataddr_string(netdissect_options *ndo,
tp->nxt = newhnamemem(ndo);
tp->name = strdup(nambuf);
if (tp->name == NULL)
- (*ndo->ndo_error)(ndo,
- "ataddr_string: strdup(nambuf)");
+ (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
+ "ataddr_string: strdup(nambuf)");
}
fclose(fp);
}
@@ -628,8 +628,8 @@ ataddr_string(netdissect_options *ndo,
tp2->name, athost);
tp->name = strdup(nambuf);
if (tp->name == NULL)
- (*ndo->ndo_error)(ndo,
- "ataddr_string: strdup(nambuf)");
+ (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
+ "ataddr_string: strdup(nambuf)");
return (tp->name);
}
@@ -641,7 +641,8 @@ ataddr_string(netdissect_options *ndo,
(void)nd_snprintf(nambuf, sizeof(nambuf), "%u", atnet);
tp->name = strdup(nambuf);
if (tp->name == NULL)
- (*ndo->ndo_error)(ndo, "ataddr_string: strdup(nambuf)");
+ (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
+ "ataddr_string: strdup(nambuf)");
return (tp->name);
}