diff options
author | 2003-03-30 21:10:27 +0000 | |
---|---|---|
committer | 2003-03-30 21:10:27 +0000 | |
commit | 0ddc0c876970f57e7643113727a244f7550a6d93 (patch) | |
tree | f8979ec7524c9f9aa26b16f58098b90f5550f7e9 /lib/libutil | |
parent | Fix probing of dual channel 7899 with some fixes from current FreeBSD (diff) | |
download | wireguard-openbsd-0ddc0c876970f57e7643113727a244f7550a6d93.tar.xz wireguard-openbsd-0ddc0c876970f57e7643113727a244f7550a6d93.zip |
more asprintf; millert ok
Diffstat (limited to 'lib/libutil')
-rw-r--r-- | lib/libutil/passwd.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c index 38ae21e1bfd..75d082c6325 100644 --- a/lib/libutil/passwd.c +++ b/lib/libutil/passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: passwd.c,v 1.37 2003/03/30 20:57:59 deraadt Exp $ */ +/* $OpenBSD: passwd.c,v 1.38 2003/03/30 21:10:27 deraadt Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -34,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$OpenBSD: passwd.c,v 1.37 2003/03/30 20:57:59 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: passwd.c,v 1.38 2003/03/30 21:10:27 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -394,10 +394,8 @@ pw_edit(notsetuid, filename) if ((editor = getenv("EDITOR")) == NULL) editor = _PATH_VI; - p = malloc(strlen(editor) + 1 + strlen(filename) + 1); - if (p == NULL) + if (asprintf(&p, "%s %s", editor, filename) == -1) return; - sprintf(p, "%s %s", editor, filename); argp[2] = p; switch (editpid = vfork()) { |