-/* $OpenBSD: apprentice.c,v 1.32 2014/10/26 04:10:26 brad Exp $ */
+/* $OpenBSD: apprentice.c,v 1.33 2015/01/16 08:24:04 doug Exp $ */
/*
* Copyright (c) Ian F. Darwin 1986-1995.
* Software written by Ian F. Darwin and others;
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
-#include <sys/param.h>
+
#include <sys/stat.h>
#include <sys/types.h>
#define MAP_FILE 0
#endif
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 1024
+#ifndef PATH_MAX
+#define PATH_MAX 1024
#endif
struct magic_entry {
int errs = 0;
struct magic_entry *marray;
uint32_t marraycount, i, mentrycount = 0, starttest;
- char subfn[MAXPATHLEN];
+ char subfn[PATH_MAX];
struct stat st;
DIR *dir;
struct dirent *d;
}
(void)asprintf(buf, "%s%s", fn, ext);
- if (*buf && strlen(*buf) > MAXPATHLEN) {
+ if (*buf && strlen(*buf) > PATH_MAX) {
free(*buf);
*buf = NULL;
}
-/* $OpenBSD: file.c,v 1.24 2015/01/16 05:46:44 deraadt Exp $ */
+/* $OpenBSD: file.c,v 1.25 2015/01/16 08:24:04 doug Exp $ */
/*
* Copyright (c) Ian F. Darwin 1986-1995.
* Software written by Ian F. Darwin and others;
*/
#include <sys/types.h>
-#include <sys/param.h> /* for MAXPATHLEN */
#include <sys/stat.h>
#include "file.h"
# define USAGE "Usage: %s [-bcik" SYMLINKFLAG "nNprsvz0] [-e test] [-f namefile] [-F separator] [-m magicfiles] file...\n" \
" %s -C -m magicfiles\n"
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 1024
+#ifndef PATH_MAX
+#define PATH_MAX 1024
#endif
private int /* Global command-line options */
private void
unwrap(char *fn)
{
- char buf[MAXPATHLEN];
+ char buf[PATH_MAX];
FILE *f;
int wid = 0, cwid;
-/* $OpenBSD: magic.c,v 1.9 2014/10/11 03:06:44 doug Exp $ */
+/* $OpenBSD: magic.c,v 1.10 2015/01/16 08:24:04 doug Exp $ */
/*
* Copyright (c) Christos Zoulas 2003.
* All Rights Reserved.
*/
#include <sys/types.h>
-#include <sys/param.h> /* for MAXPATHLEN */
#include <sys/stat.h>
#include "file.h"