summaryrefslogtreecommitdiff
path: root/usr.sbin/popa3d/mailbox.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-02 00:07:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-02 00:07:54 +0000
commit0a9e1209814e7fa982c1ac84ef7647358fba5c1c (patch)
treeebb4293affc6af8a6b3b6e1bc943f6bcc270b987 /usr.sbin/popa3d/mailbox.c
parente6a4b8c7dfa4c88e9971d69bf703864aa6e36ba5 (diff)
asprintf; millert ok
Diffstat (limited to 'usr.sbin/popa3d/mailbox.c')
-rw-r--r--usr.sbin/popa3d/mailbox.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/popa3d/mailbox.c b/usr.sbin/popa3d/mailbox.c
index c5b5a6b9764..ae7e58f8902 100644
--- a/usr.sbin/popa3d/mailbox.c
+++ b/usr.sbin/popa3d/mailbox.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mailbox.c,v 1.4 2002/09/06 19:18:10 deraadt Exp $ */
+/* $OpenBSD: mailbox.c,v 1.5 2003/04/02 00:07:53 deraadt Exp $ */
/*
* Mailbox access.
@@ -294,9 +294,8 @@ int mailbox_open(char *spool, char *mailbox)
mailbox_fd = -1;
- pathname = malloc(strlen(spool) + strlen(mailbox) + 2);
- if (!pathname) return 1;
- sprintf(pathname, "%s/%s", spool, mailbox);
+ if (asprintf(&pathname, "%s/%s", spool, mailbox) == -1)
+ return 1;
if (lstat(pathname, &stat)) {
free(pathname);