projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Addinfo is host when ZOOM returns failure for connections
[yaz-moved-to-github.git]
/
rfc1006
/
makensap.c
diff --git
a/rfc1006/makensap.c
b/rfc1006/makensap.c
index
d802c42
..
ca1bd7d
100644
(file)
--- a/
rfc1006/makensap.c
+++ b/
rfc1006/makensap.c
@@
-26,8
+26,8
@@
int makensap(char *text, unsigned char *binary)
fprintf(stderr, "Mapping textform NSAP '%s'\n", text);
if (!(addr = tcpip_strtoaddr(text)))
{
fprintf(stderr, "Mapping textform NSAP '%s'\n", text);
if (!(addr = tcpip_strtoaddr(text)))
{
- fprintf(stderr, "Failed to resolve '%s'\n", text);
- return -1;
+ fprintf(stderr, "Failed to resolve '%s'\n", text);
+ return -1;
}
memcpy(binary, addr, sizeof(struct sockaddr_in));
return sizeof(struct sockaddr_in);
}
memcpy(binary, addr, sizeof(struct sockaddr_in));
return sizeof(struct sockaddr_in);
@@
-48,15
+48,23
@@
static struct sockaddr_in *tcpip_strtoaddr(const char *str)
strcpy(buf, str);
if ((p = strchr(buf, ':')))
{
strcpy(buf, str);
if ((p = strchr(buf, ':')))
{
- *p = 0;
- port = atoi(p + 1);
+ *p = 0;
+ port = atoi(p + 1);
}
add.sin_port = htons(port);
if ((hp = gethostbyname(buf)))
}
add.sin_port = htons(port);
if ((hp = gethostbyname(buf)))
- memcpy(&add.sin_addr.s_addr, *hp->h_addr_list, sizeof(struct in_addr));
+ memcpy(&add.sin_addr.s_addr, *hp->h_addr_list, sizeof(struct in_addr));
else if ((tmpadd = inet_addr(buf)) != 0)
else if ((tmpadd = inet_addr(buf)) != 0)
- memcpy(&add.sin_addr.s_addr, &tmpadd, sizeof(struct in_addr));
+ memcpy(&add.sin_addr.s_addr, &tmpadd, sizeof(struct in_addr));
else
else
- return 0;
+ return 0;
return &add;
}
return &add;
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+