summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2003-01-30 15:41:35 +0000
committerhenning <henning@openbsd.org>2003-01-30 15:41:35 +0000
commite9275b6c65ea95c7dec2d760b9c2f99d4eb16782 (patch)
treeed36197717b214479e2da02467d17b0bfb166fb0
parentTrack if a physical page has been previously mapped executable. If it (diff)
downloadwireguard-openbsd-e9275b6c65ea95c7dec2d760b9c2f99d4eb16782.tar.xz
wireguard-openbsd-e9275b6c65ea95c7dec2d760b9c2f99d4eb16782.zip
in these two cases strdup makes more sense than asprintf, pointed out by
camield@
-rw-r--r--sbin/pfctl/pfctl_parser.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index 35c4467db75..bb3196f5441 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.135 2003/01/30 15:03:49 henning Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.136 2003/01/30 15:41:35 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1155,8 +1155,8 @@ host(char *s, int mask)
fprintf(stderr, "invalid netmask\n");
return (NULL);
}
- if (asprintf(&buf, "%s", s) == -1)
- err(1, "host: asprintf");
+ if ((buf = strdup(s)) == NULL)
+ err(1, "host: strdup");
if ((ps = malloc(strlen(s) - strlen(p) + 1)) == NULL)
err(1, "host: malloc");
strlcpy(ps, s, strlen(s) - strlen(p) + 1);
@@ -1172,8 +1172,8 @@ host(char *s, int mask)
"extra netmask given\n");
return (NULL);
}
- if (asprintf(&buf, "%s", s) == -1)
- err(1, "host: asprintf");
+ if ((buf = strdup(s)) == NULL)
+ err(1, "host: strdup");
if ((ps = malloc(strlen(s) - strlen(p) + 1)) == NULL)
err(1, "host: malloc");
strlcpy(ps, s, strlen(s) - strlen(p) + 1);