Browse Source

more asprintf; millert ok

OPENBSD_3_4
deraadt 21 years ago
parent
commit
d3c9af5aa3
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      src/lib/libutil/passwd.c

+ 3
- 5
src/lib/libutil/passwd.c View File

@ -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()) {


Loading…
Cancel
Save