summaryrefslogtreecommitdiffstats
path: root/contrib/pf/pfctl/pfctl_osfp.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pf/pfctl/pfctl_osfp.c')
-rw-r--r--contrib/pf/pfctl/pfctl_osfp.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/contrib/pf/pfctl/pfctl_osfp.c b/contrib/pf/pfctl/pfctl_osfp.c
index 6d1fb99..23e3ccc 100644
--- a/contrib/pf/pfctl/pfctl_osfp.c
+++ b/contrib/pf/pfctl/pfctl_osfp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_osfp.c,v 1.8 2004/02/27 10:42:00 henning Exp $ */
+/* $OpenBSD: pfctl_osfp.c,v 1.12 2005/02/17 13:18:00 aaron Exp $ */
/*
* Copyright (c) 2003 Mike Frantzen <frantzen@openbsd.org>
@@ -97,8 +97,8 @@ pfctl_file_fingerprints(int dev, int opts, const char *fp_filename)
pfctl_flush_my_fingerprints(&classes);
- if ((in = fopen(fp_filename, "r")) == NULL) {
- warn("fopen(%s)", fp_filename);
+ if ((in = pfctl_fopen(fp_filename, "r")) == NULL) {
+ warn("%s", fp_filename);
return (1);
}
class = version = subtype = desc = tcpopts = NULL;
@@ -276,9 +276,9 @@ pfctl_flush_my_fingerprints(struct name_list *list)
while ((nm = LIST_FIRST(list)) != NULL) {
LIST_REMOVE(nm, nm_entry);
pfctl_flush_my_fingerprints(&nm->nm_sublist);
- fingerprint_count--;
free(nm);
}
+ fingerprint_count = 0;
class_count = 0;
}
@@ -348,7 +348,7 @@ pfctl_get_fingerprint(const char *name)
if ((wr_name = strdup(name)) == NULL)
err(1, "malloc");
- if ((ptr = index(wr_name, ' ')) == NULL) {
+ if ((ptr = strchr(wr_name, ' ')) == NULL) {
free(wr_name);
return (PF_OSFP_NOMATCH);
}
@@ -508,9 +508,9 @@ found:
strlcat(buf, " ", len);
strlcat(buf, version_name, len);
if (subtype_name) {
- if (index(version_name, ' '))
+ if (strchr(version_name, ' '))
strlcat(buf, " ", len);
- else if (index(version_name, '.') &&
+ else if (strchr(version_name, '.') &&
isdigit(*subtype_name))
strlcat(buf, ".", len);
else
@@ -702,9 +702,8 @@ fingerprint_name_entry(struct name_list *list, char *name)
nm_entry = calloc(1, sizeof(*nm_entry));
if (nm_entry == NULL)
err(1, "calloc");
- LIST_INIT(&nm_entry->nm_sublist);
- strlcpy(nm_entry->nm_name, name,
- sizeof(nm_entry->nm_name));
+ LIST_INIT(&nm_entry->nm_sublist);
+ strlcpy(nm_entry->nm_name, name, sizeof(nm_entry->nm_name));
}
LIST_INSERT_HEAD(list, nm_entry, nm_entry);
return (nm_entry);
OpenPOWER on IntegriCloud