{
char *p;
int client, port;
+ int len;
assert(seq && addr && arg);
- if ((p = strpbrk(arg, ":.")) == NULL)
- return -EINVAL;
- if ((port = atoi(p + 1)) < 0)
- return -EINVAL;
+ if ((p = strpbrk(arg, ":.")) != NULL) {
+ if ((port = atoi(p + 1)) < 0)
+ return -EINVAL;
+ len = (int)(p - arg); /* length of client name */
+ } else {
+ port = 0;
+ len = strlen(arg);
+ }
addr->port = port;
if (isdigit(*arg)) {
client = atoi(arg);
int len;
*p = 0;
- len = (int)(p - arg); /* length of client name */
if (len <= 0)
return -EINVAL;
cinfo.client = -1;