Use MAXHOSTNAMELEN (256) for the array holding the host_name in socket.c
authorDavid Dykstra <dwd@samba.org>
Tue, 9 Feb 1999 18:35:29 +0000 (18:35 +0000)
committerDavid Dykstra <dwd@samba.org>
Tue, 9 Feb 1999 18:35:29 +0000 (18:35 +0000)
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
params.c
rsync.h
socket.c

index 9b28c3b..b87d24a 100644 (file)
@@ -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")
index b1093c3..d87961b 100644 (file)
--- 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 d24cdf7..258695f 100644 (file)
--- 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"
 
 #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
index b9f01a6..e7e98a6 100644 (file)
--- 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;