aboutsummaryrefslogtreecommitdiff
path: root/icmp_t.c
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2024-06-03 22:40:29 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2024-06-03 22:40:29 -0300
commitfdef1594ca36478db782ea6031593f0c23da7896 (patch)
tree74ad876def62dfe56d38f5816b8d6283e38acdca /icmp_t.c
parent8badf9c493c7dd56db5e88e246d5970696795c07 (diff)
New upstream version 1.0.18upstream
Diffstat (limited to 'icmp_t.c')
-rw-r--r--icmp_t.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/icmp_t.c b/icmp_t.c
index 3620920..5262efa 100644
--- a/icmp_t.c
+++ b/icmp_t.c
@@ -322,11 +322,14 @@ static struct icmpmsg icmpmsgs[] = {
{ 256, 256, "impossible combination", "impossible combination" }
};
+static struct icmpmsg icmperror =
+ { 256, 256, "unknown", "unknown" };
+
struct icmpmsg *stricmp(int type, int code)
{
int i;
- if(type > 255) return(&((struct icmpmsg) { 256, 256, "unknown", "unknown" }));
+ if(type > 255) return &icmperror;
for(i = 0; icmpmsgs[i].type <= type; i++)
if(icmpmsgs[i].type == type && icmpmsgs[i].code == code) return(&(icmpmsgs[i]));
@@ -334,7 +337,7 @@ struct icmpmsg *stricmp(int type, int code)
for(i = 0; icmpmsgs[i].type <= type; i++)
if(icmpmsgs[i].type == type) return(&(icmpmsgs[i]));
- return(&((struct icmpmsg) { 256, 256, "unknown", "unknown" }));
+ return &icmperror;
}
/* EOF */