summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-02-04 01:25:35 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-02-04 01:25:35 +0000
commit27e2251e32c63a19c025daa4732d6335e6ed0973 (patch)
treed68839e591af1043a1ab8ac5f1d20104eb1bb3c1
parentb12ff12eb3ebaff2815c32a57a644eb2e93e8da8 (diff)
asprintf
-rw-r--r--sbin/dhclient/clparse.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c
index 13dde3f89bb..da10493c705 100644
--- a/sbin/dhclient/clparse.c
+++ b/sbin/dhclient/clparse.c
@@ -677,11 +677,9 @@ parse_option_decl(FILE *cfile, struct option_data *options)
skip_to_semi(cfile);
return (NULL);
}
- /* XXXFIX asprintf */
- vendor = malloc(strlen(val) + 1);
- if (!vendor)
+ if (asprintf(&vendor, "%s", val) == -1)
error("no memory for vendor information.");
- strlcpy(vendor, val, strlen(val) + 1);
+
token = peek_token (&val, cfile);
if (token == DOT) {
/* Go ahead and take the DOT token... */
@@ -876,7 +874,6 @@ parse_string_list (FILE *cfile, struct string_list **lp, int multiple)
return;
}
- /* XXXFIX asprintf */
tmp = new_string_list(strlen(val) + 1, "parse tmp");
if (tmp == NULL)
error ("no memory for string list entry.");