summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-04-06 04:15:32 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-04-06 04:15:32 +0000
commitf55330f67f5d8f384f364f1c35cbf5bf1e25b367 (patch)
tree1b7e14441e4c80e6aa5c10710e68f7c5eb2d5385
parent5b99ce8fbe8dca73e232164f7a5605e9e7312dd2 (diff)
o use MAXHOSTNAMELEN, MAXPATHLEN and MAXLOGNAME instead of arbitrary sizes
o tempfile[] was 2 bytes larger than it needs to be since sizeof(foo) already includes a byte for the NUL. krw@ OK
-rw-r--r--usr.bin/oldrdist/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/oldrdist/main.c b/usr.bin/oldrdist/main.c
index fb4309c8afd..2483917c0b1 100644
--- a/usr.bin/oldrdist/main.c
+++ b/usr.bin/oldrdist/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.16 2003/04/05 17:18:26 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.17 2003/04/06 04:15:31 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -41,7 +41,7 @@ static char copyright[] =
#ifndef lint
/* from: static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/9/93"; */
-static char *rcsid = "$OpenBSD: main.c,v 1.16 2003/04/05 17:18:26 deraadt Exp $";
+static char *rcsid = "$OpenBSD: main.c,v 1.17 2003/04/06 04:15:31 millert Exp $";
#endif /* not lint */
#include <stdarg.h>
@@ -56,7 +56,7 @@ static char *rcsid = "$OpenBSD: main.c,v 1.16 2003/04/05 17:18:26 deraadt Exp $"
char *distfile = NULL;
#define _RDIST_TMP "rdistXXXXXXXXXX"
-char tempfile[sizeof _PATH_TMP + sizeof _RDIST_TMP + 1];
+char tempfile[sizeof _PATH_TMP + sizeof _RDIST_TMP - 1];
char *tempname;
int debug; /* debugging flag */
@@ -67,10 +67,10 @@ int iamremote; /* act as remote server for transfering files */
FILE *fin = NULL; /* input file pointer */
int rem = -1; /* file descriptor to remote source/sink process */
-char host[32]; /* host name */
+char host[MAXHOSTNAMELEN]; /* host name */
int nerrs; /* number of errors while sending/receiving */
-char user[40]; /* user's name */
-char homedir[128]; /* user's home directory */
+char user[MAXLOGNAME]; /* user's name */
+char homedir[MAXPATHLEN]; /* user's home directory */
uid_t userid; /* user's user ID */
gid_t groupid; /* user's group ID */