summaryrefslogtreecommitdiffstats
path: root/usr.bin/uudecode/uudecode.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/uudecode/uudecode.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/uudecode/uudecode.c')
-rw-r--r--usr.bin/uudecode/uudecode.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c
index 2b03e6ef615..65801e1093b 100644
--- a/usr.bin/uudecode/uudecode.c
+++ b/usr.bin/uudecode/uudecode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uudecode.c,v 1.19 2014/05/20 01:25:23 guenther Exp $ */
+/* $OpenBSD: uudecode.c,v 1.20 2015/01/16 06:40:13 deraadt Exp $ */
/* $FreeBSD: uudecode.c,v 1.49 2003/05/03 19:44:46 obrien Exp $ */
/*-
@@ -35,7 +35,6 @@
* Used with uuencode.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -51,6 +50,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
static const char *infile, *outfile;
static FILE *infp, *outfp;
@@ -182,7 +182,7 @@ decode2(void)
void *handle;
struct passwd *pw;
struct stat st;
- char buf[MAXPATHLEN];
+ char buf[PATH_MAX];
base64 = 0;
/* search for header line */
@@ -334,7 +334,7 @@ uu_decode(void)
{
int i, ch;
char *p;
- char buf[MAXPATHLEN];
+ char buf[PATH_MAX];
/* for each input line */
for (;;) {
@@ -412,8 +412,8 @@ static int
base64_decode(void)
{
int n;
- char inbuf[MAXPATHLEN];
- unsigned char outbuf[MAXPATHLEN * 4];
+ char inbuf[PATH_MAX];
+ unsigned char outbuf[PATH_MAX * 4];
for (;;) {
switch (get_line(inbuf, sizeof(inbuf))) {