summaryrefslogtreecommitdiff
path: root/lib/ipoptsec.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ipoptsec.c')
-rw-r--r--lib/ipoptsec.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/ipoptsec.c b/lib/ipoptsec.c
index a59db23616fdc..96400bffc1a4e 100644
--- a/lib/ipoptsec.c
+++ b/lib/ipoptsec.c
@@ -1,9 +1,9 @@
/*
- * Copyright (C) 2001-2002 by Darren Reed.
+ * Copyright (C) 2012 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * $Id: ipoptsec.c,v 1.2.4.1 2006/06/16 17:21:04 darrenr Exp $
+ * $Id$
*/
#include "ipf.h"
@@ -23,16 +23,19 @@ struct ipopt_names secclass[] = {
u_char seclevel(slevel)
-char *slevel;
+ char *slevel;
{
struct ipopt_names *so;
+ if (slevel == NULL || *slevel == '\0')
+ return 0;
+
for (so = secclass; so->on_name; so++)
if (!strcasecmp(slevel, so->on_name))
break;
if (!so->on_name) {
- fprintf(stderr, "no such security level: %s\n", slevel);
+ fprintf(stderr, "no such security level: '%s'\n", slevel);
return 0;
}
return (u_char)so->on_value;
@@ -40,7 +43,7 @@ char *slevel;
u_char secbit(class)
-int class;
+ int class;
{
struct ipopt_names *so;
@@ -49,7 +52,7 @@ int class;
break;
if (!so->on_name) {
- fprintf(stderr, "no such security class: %d\n", class);
+ fprintf(stderr, "no such security class: %d.\n", class);
return 0;
}
return (u_char)so->on_bit;