diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2016-04-22 16:23:46 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2016-04-22 16:23:46 +0200 |
commit | 5f06441c06d46499743689468971ecea9e14f984 (patch) | |
tree | 2aa88c575952d4a2ec59d94fd1bc809fc7da33ca /trafgen_proto.c | |
parent | f2478b5dde8fcdfa1bf33065e0e55c4bd181a1d2 (diff) |
trafgen: proto: Replace panic() with bug() where applicable
In some cases we use panic() in situations where the error could only
happen due to an implementation error. Use bug() there as it is more
applicable, as panic() is mainly used to report system call errors.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_proto.c')
-rw-r--r-- | trafgen_proto.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/trafgen_proto.c b/trafgen_proto.c index d0b5580..e3704d8 100644 --- a/trafgen_proto.c +++ b/trafgen_proto.c @@ -128,8 +128,7 @@ struct proto_hdr *proto_header_init(enum proto_id pid) struct proto_hdr *hdr = proto_header_by_id(pid); struct proto_hdr *new_hdr; - if (headers_count >= PROTO_MAX_LAYERS) - panic("Too many proto headers\n"); + bug_on(headers_count >= PROTO_MAX_LAYERS); new_hdr = xmalloc(sizeof(*new_hdr)); memcpy(new_hdr, hdr, sizeof(*new_hdr)); |