nameservice: remove some dead code
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 11:21:05 +0000 (13:21 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 11:45:14 +0000 (13:45 +0200)
Coverity:
CID 739633 (#1 of 1): Logically dead code (DEADCODE)
  Execution cannot reach this expression "127" inside statement
  "tmp->len = ((len_of_name > ...".
  (The condition "len_of_name > 127U" cannot be true.)

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/nameservice/src/nameservice.c

index b467747..04873f2 100644 (file)
@@ -865,7 +865,7 @@ decap_namemsg(struct name *from_packet, struct name_entry **to, bool * this_tabl
   //if not yet known entry
   tmp = olsr_malloc(sizeof(struct name_entry), "new name_entry");
   tmp->type = ntohs(from_packet->type);
-  tmp->len = len_of_name > MAX_NAME ? MAX_NAME : ntohs(from_packet->len);
+  tmp->len = ntohs(from_packet->len);
   tmp->name = olsr_malloc(tmp->len + 1, "new name_entry name");
   tmp->ip = from_packet->ip;
   strscpy(tmp->name, name, tmp->len + 1);