summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/checkout.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
committerderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
commitb9fc9a728fce9c4289b7e9a992665e28d5629a54 (patch)
tree72b2433e418dfa1aef5fcf8305617b97979a25d8 /usr.bin/cvs/checkout.c
parentimprove checksum parsing slightly. now handles filenames with spaces. (diff)
downloadwireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.tar.xz
wireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.zip
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'usr.bin/cvs/checkout.c')
-rw-r--r--usr.bin/cvs/checkout.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c
index 24c922ede54..ea1a0ddd0d3 100644
--- a/usr.bin/cvs/checkout.c
+++ b/usr.bin/cvs/checkout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: checkout.c,v 1.168 2011/12/27 13:59:01 nicm Exp $ */
+/* $OpenBSD: checkout.c,v 1.169 2015/01/16 06:40:06 deraadt Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -15,7 +15,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/dirent.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -239,7 +239,7 @@ checkout_check_repository(int argc, char **argv)
struct module_checkout *mc;
struct cvs_ignpat *ip;
struct cvs_filelist *fl, *nxt;
- char repo[MAXPATHLEN], fpath[MAXPATHLEN], *f[1];
+ char repo[PATH_MAX], fpath[PATH_MAX], *f[1];
build_dirs = print_stdout ? 0 : 1;
@@ -388,7 +388,7 @@ checkout_check_repository(int argc, char **argv)
static int
checkout_classify(const char *repo, const char *arg)
{
- char *d, *f, fpath[MAXPATHLEN];
+ char *d, *f, fpath[PATH_MAX];
struct stat sb;
if (stat(repo, &sb) == 0) {
@@ -477,7 +477,7 @@ cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, char *tag, int co_flags)
char *entry, *tosend;
char kbuf[8], sticky[CVS_REV_BUFSZ], rev[CVS_REV_BUFSZ];
char timebuf[CVS_TIME_BUFSZ], tbuf[CVS_TIME_BUFSZ];
- static char lastwd[MAXPATHLEN];
+ static char lastwd[PATH_MAX];
exists = 0;
tosend = NULL;
@@ -606,7 +606,7 @@ cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, char *tag, int co_flags)
*/
if (tag != NULL && strcmp(cf->file_wd, lastwd) &&
!(cf->file_flags & FILE_USER_SUPPLIED)) {
- strlcpy(lastwd, cf->file_wd, MAXPATHLEN);
+ strlcpy(lastwd, cf->file_wd, PATH_MAX);
cvs_server_set_sticky(cf->file_wd, sticky);
}