From f77677c542c1b42d6a76cd114ae8f2ea6b07641e Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Thu, 17 Jan 2008 17:43:38 +0000 Subject: Max Kellermann : eliminate local variable by returning from the loop --- src/conntrack.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/conntrack.c') diff --git a/src/conntrack.c b/src/conntrack.c index f170bed..4d0642c 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -156,19 +156,17 @@ void register_proto(struct ctproto_handler *h) static struct ctproto_handler *findproto(char *name) { - struct ctproto_handler *cur, *handler = NULL; + struct ctproto_handler *cur; if (!name) - return handler; + return NULL; list_for_each_entry(cur, &proto_list, head) { - if (strcmp(cur->name, name) == 0) { - handler = cur; - break; - } + if (strcmp(cur->name, name) == 0) + return cur; } - return handler; + return NULL; } static void -- cgit v1.2.3