From: Martin Pool Date: Wed, 15 Aug 2001 05:47:29 +0000 (+0000) Subject: Typo. Shouldn't depend on assert(). X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/f8014b864e81af1220ed6d339332b4d203fe510d Typo. Shouldn't depend on assert(). --- diff --git a/socket.c b/socket.c index 23292cd5..5860ce79 100644 --- a/socket.c +++ b/socket.c @@ -496,7 +496,7 @@ char *client_name(int fd) hp = gethostbyname(name_buf); if (!hp) { strcpy (name_buf,def); - rprint (FERROR, "reverse name lookup for \"%s\" failed\n", + rprintf (FERROR, "reverse name lookup for \"%s\" failed\n", name_buf); } else { for (p=hp->h_addr_list;*p;p++) { @@ -525,7 +525,10 @@ struct in_addr *ip_address(const char *str) static struct in_addr ret; struct hostent *hp; - assert (str); + if (!str) { + rprintf (FERROR, "ip_address received NULL name\n"); + return NULL; + } /* try as an IP address */ if (inet_aton(str, &ret) != 0) {