Moved inline functions from rsync.h into ifuncs.h.
[rsync/rsync.git] / socket.c
index 9017007..ca8c561 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -25,6 +25,7 @@
  * emulate it using the KAME implementation. */
 
 #include "rsync.h"
+#include "ifuncs.h"
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/tcp.h>
@@ -300,7 +301,7 @@ int open_socket_out_wrapped(char *host, int port, const char *bind_addr,
 {
        char *prog = getenv("RSYNC_CONNECT_PROG");
 
-       if (strchr(prog, '%')) {
+       if (prog && strchr(prog, '%')) {
                int hlen = strlen(host);
                int len = strlen(prog) + 1;
                char *f, *t;