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 9b28c3b2a7766bc476d257af779188a2d3601d2d..b87d24a6a90233fce782ad194aa2dc3675962316 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 b1093c3c7cd2ff4071d8f1ae313b9ca65163fd07..d87961b8576a896a1ddf3cb88fa394addaf536d2 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 d24cdf79c598bb6d7b582b4423d726c9faed14a0..258695f82bd77feb58221ae6e46a4d1301c84e27 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 b9f01a616ae2e416e849145da0f3ef803bb84f10..e7e98a69a368ff1d8415adb755b8b9bf048eedaa 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;