diff options
| author | 2015-01-16 06:39:28 +0000 | |
|---|---|---|
| committer | 2015-01-16 06:39:28 +0000 | |
| commit | b9fc9a728fce9c4289b7e9a992665e28d5629a54 (patch) | |
| tree | 72b2433e418dfa1aef5fcf8305617b97979a25d8 /usr.bin/cvs/entries.c | |
| parent | improve checksum parsing slightly. now handles filenames with spaces. (diff) | |
| download | wireguard-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/entries.c')
| -rw-r--r-- | usr.bin/cvs/entries.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index a4e2ce7a3f8..36fc65da695 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.102 2009/03/19 09:53:16 joris Exp $ */ +/* $OpenBSD: entries.c,v 1.103 2015/01/16 06:40:07 deraadt Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -35,7 +35,7 @@ cvs_ent_open(const char *dir) { FILE *fp; CVSENTRIES *ep; - char *p, buf[MAXPATHLEN]; + char *p, buf[PATH_MAX]; struct cvs_ent *ent; struct cvs_ent_line *line; @@ -422,7 +422,7 @@ cvs_parse_tagfile(char *dir, char **tagp, char **datep, int *nbp) int i, linenum; size_t len; struct tm datetm; - char linebuf[128], tagpath[MAXPATHLEN]; + char linebuf[128], tagpath[PATH_MAX]; cvs_directory_date = -1; @@ -435,8 +435,8 @@ cvs_parse_tagfile(char *dir, char **tagp, char **datep, int *nbp) if (nbp != NULL) *nbp = 0; - i = snprintf(tagpath, MAXPATHLEN, "%s/%s", dir, CVS_PATH_TAG); - if (i < 0 || i >= MAXPATHLEN) + i = snprintf(tagpath, PATH_MAX, "%s/%s", dir, CVS_PATH_TAG); + if (i < 0 || i >= PATH_MAX) return; if ((fp = fopen(tagpath, "r")) == NULL) { @@ -499,7 +499,7 @@ cvs_write_tagfile(const char *dir, char *tag, char *date) { FILE *fp; RCSNUM *rev; - char tagpath[MAXPATHLEN]; + char tagpath[PATH_MAX]; char sticky[CVS_REV_BUFSZ]; struct tm datetm; int i; @@ -510,8 +510,8 @@ cvs_write_tagfile(const char *dir, char *tag, char *date) if (cvs_noexec == 1) return; - i = snprintf(tagpath, MAXPATHLEN, "%s/%s", dir, CVS_PATH_TAG); - if (i < 0 || i >= MAXPATHLEN) + i = snprintf(tagpath, PATH_MAX, "%s/%s", dir, CVS_PATH_TAG); + if (i < 0 || i >= PATH_MAX) return; if (tag != NULL || cvs_specified_date != -1 || |
