diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2007-01-11 08:49:00 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2007-01-11 08:49:00 +0000 |
commit | 97fb82eae36e61316b14fba8c0c5047ab4cf2ea6 (patch) | |
tree | afd30b922eb401e4482b5503ed154f05241d0cc4 /usr.bin/cvs | |
parent | 1c5a8e2752a09636d252fdabdb1bb4396d5571de (diff) |
strl* overload, use xasprintf().
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/logmsg.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/usr.bin/cvs/logmsg.c b/usr.bin/cvs/logmsg.c index 6061a5d19f1..2bae1b6e69a 100644 --- a/usr.bin/cvs/logmsg.c +++ b/usr.bin/cvs/logmsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: logmsg.c,v 1.34 2007/01/11 08:33:53 xsa Exp $ */ +/* $OpenBSD: logmsg.c,v 1.35 2007/01/11 08:48:59 xsa Exp $ */ /* * Copyright (c) 2007 Joris Vink <joris@openbsd.org> * @@ -86,20 +86,12 @@ cvs_logmsg_create(struct cvs_flisthead *added, struct cvs_flisthead *removed, struct cvs_flisthead *modified) { FILE *fp; - size_t len; int c, fd, argc, saved_errno; struct cvs_filelist *cf; struct stat st1, st2; char *fpath, *logmsg, *argv[4]; - fpath = xmalloc(MAXPATHLEN); - len = strlcpy(fpath, cvs_tmpdir, MAXPATHLEN); - if (len >= MAXPATHLEN) - fatal("cvs_logmsg_create: truncation"); - - len = strlcat(fpath, "/cvsXXXXXXXXXX", MAXPATHLEN); - if (len >= MAXPATHLEN) - fatal("cvs_logmsg_create: truncation"); + (void)xasprintf(&fpath, "%s/cvsXXXXXXXXXX", cvs_tmpdir); if ((fd = mkstemp(fpath)) == NULL) fatal("cvs_logmsg_create: mkstemp %s", strerror(errno)); |