From d41c7d025c1725b921ef51c70a705a51b5c36332 Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Tue, 9 Feb 1999 18:35:29 +0000 Subject: [PATCH] Use MAXHOSTNAMELEN (256) for the array holding the host_name in socket.c instead of 200. Move the defines of True and False to rsync.h. Eliminate the defines of BOOL in loadparm.c and params.c because it is already defined in rsync.h. Changes suggested by Roman Gollent roman.gollent@wdr.com --- loadparm.c | 3 --- params.c | 3 --- rsync.h | 7 +++++++ socket.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/loadparm.c b/loadparm.c index 9b28c3b2..b87d24a6 100644 --- a/loadparm.c +++ b/loadparm.c @@ -44,9 +44,6 @@ */ #include "rsync.h" -#define BOOL int -#define False 0 -#define True 1 #define PTR_DIFF(p1,p2) ((ptrdiff_t)(((char *)(p1)) - (char *)(p2))) #define strequal(a,b) (strcasecmp(a,b)==0) #define BOOLSTR(b) ((b) ? "Yes" : "No") diff --git a/params.c b/params.c index b1093c3c..d87961b8 100644 --- a/params.c +++ b/params.c @@ -74,9 +74,6 @@ */ #include "rsync.h" -#define BOOL int -#define False 0 -#define True 1 /* -------------------------------------------------------------------------- ** * Constants... diff --git a/rsync.h b/rsync.h index d24cdf79..258695f8 100644 --- a/rsync.h +++ b/rsync.h @@ -17,6 +17,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define False 0 +#define True 1 + #define BLOCK_SIZE 700 #define RSYNC_RSH_ENV "RSYNC_RSH" @@ -270,6 +273,10 @@ #define MAX(a,b) ((a)>(b)?(a):(b)) #endif +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 256 +#endif + /* the length of the md4 checksum */ #define MD4_SUM_LENGTH 16 #define SUM_LENGTH 16 diff --git a/socket.c b/socket.c index b9f01a61..e7e98a69 100644 --- a/socket.c +++ b/socket.c @@ -67,7 +67,7 @@ static int open_socket_in(int type, int port) { struct hostent *hp; struct sockaddr_in sock; - char host_name[200]; + char host_name[MAXHOSTNAMELEN]; int res; int one=1; -- 2.34.1