summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authoritojun <itojun@NetBSD.org>2003-07-13 12:00:55 +0000
committeritojun <itojun@NetBSD.org>2003-07-13 12:00:55 +0000
commite19eff3a82cef7bbb9547c526bb2db0372ffefa6 (patch)
treefa1498c42ded4d86d7b4aa3609152185eeabfd4b /libexec
parenta21d1e7a14d40df307b7d59d5ddd98bcc6813ef4 (diff)
asprintf is easier
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rmail/rmail.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libexec/rmail/rmail.c b/libexec/rmail/rmail.c
index bc5afe8ce17..82539d89a59 100644
--- a/libexec/rmail/rmail.c
+++ b/libexec/rmail/rmail.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rmail.c,v 1.16 2003/04/05 17:45:11 perry Exp $ */
+/* $NetBSD: rmail.c,v 1.17 2003/07/13 12:00:55 itojun Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\
#if 0
static char sccsid[] = "@(#)rmail.c 8.3 (Berkeley) 5/15/95";
#else
-__RCSID("$NetBSD: rmail.c,v 1.16 2003/04/05 17:45:11 perry Exp $");
+__RCSID("$NetBSD: rmail.c,v 1.17 2003/07/13 12:00:55 itojun Exp $");
#endif
#endif /* not lint */
@@ -284,9 +284,8 @@ main(argc, argv)
if (strchr(*argv, ',') == NULL || strchr(*argv, '<') != NULL)
args[i++] = *argv;
else {
- if ((args[i] = malloc(strlen(*argv) + 3)) == NULL)
+ if (asprintf(&args[i++], "<%s>", *argv) < 0)
err(EX_TEMPFAIL, "Cannot malloc");
- sprintf (args [i++], "<%s>", *argv);
}
argv++;
}