diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2024-06-03 22:40:29 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2024-06-03 22:48:44 -0300 |
| commit | 18daa36e5531db0aeb9454a694ab79ddd840986e (patch) | |
| tree | 44520c48bc87fdaf79bc2dcdbfaee5a68021b56a /icmp_t.c | |
| parent | e0c6ccf0ade7b6eddbe888590eec1b7d21f1051b (diff) | |
New upstream version 1.0.18upstream/1.0.18
Diffstat (limited to 'icmp_t.c')
| -rw-r--r-- | icmp_t.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 */ |
