Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use socklen_t for getpeername, since we hopefully now have it defined
[rsync/rsync.git]
/
socket.c
diff --git
a/socket.c
b/socket.c
index
23292cd
..
870e760
100644
(file)
--- a/
socket.c
+++ b/
socket.c
@@
-443,7
+443,7
@@
char *client_addr(int fd)
{
struct sockaddr sa;
struct sockaddr_in *sockin = (struct sockaddr_in *) (&sa);
{
struct sockaddr sa;
struct sockaddr_in *sockin = (struct sockaddr_in *) (&sa);
-
int
length = sizeof(sa);
+
socklen_t
length = sizeof(sa);
static char addr_buf[100];
static int initialised;
static char addr_buf[100];
static int initialised;
@@
-496,7
+496,7
@@
char *client_name(int fd)
hp = gethostbyname(name_buf);
if (!hp) {
strcpy (name_buf,def);
hp = gethostbyname(name_buf);
if (!hp) {
strcpy (name_buf,def);
- rprint (FERROR, "reverse name lookup for \"%s\" failed\n",
+ rprint
f
(FERROR, "reverse name lookup for \"%s\" failed\n",
name_buf);
} else {
for (p=hp->h_addr_list;*p;p++) {
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;
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) {
/* try as an IP address */
if (inet_aton(str, &ret) != 0) {