summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'daemon')
-rw-r--r--daemon/fromd/fromc.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/daemon/fromd/fromc.c b/daemon/fromd/fromc.c
index 5ad3f7f1..4782230c 100644
--- a/daemon/fromd/fromc.c
+++ b/daemon/fromd/fromc.c
@@ -15,21 +15,16 @@ int main(int argc, char *argv[])
memset(buf, 0, sizeof(buf));
if (argc < 4) {
- fprintf(stderr, "Usage: %s ip port lookup_ip\n", argv[0]);
+ fprintf(stderr, "Usage: %s ip:port lookup_ip\n", argv[0]);
return 0;
}
- if ( (port = atoi(argv[2])) == 0 ) {
- fprintf(stderr, "Port given is not valid\n");
- return 1;
- }
-
- if ( (fd = toconnect(argv[1], port)) < 0 ) {
+ if ( (fd = toconnect(argv[1])) < 0 ) {
perror("toconnect");
return 1;
}
- write(fd, argv[3], strlen(argv[3]));
+ write(fd, argv[2], strlen(argv[2]));
read(fd, buf, sizeof(buf));
printf("%s\n", buf);