summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-10 12:19:54 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-10 12:19:54 +0800
commite395b3876b3974723c29e6f92dc305d308ed1e40 (patch)
treea9a80ea8e9cea5465964c3c5a7cf60fd3e400b97 /daemon
parent7c766bf44d652f4f4ffad199c3fc556f82195d1f (diff)
downloadpttbbs-e395b3876b3974723c29e6f92dc305d308ed1e40.tar
pttbbs-e395b3876b3974723c29e6f92dc305d308ed1e40.tar.gz
pttbbs-e395b3876b3974723c29e6f92dc305d308ed1e40.tar.bz2
pttbbs-e395b3876b3974723c29e6f92dc305d308ed1e40.tar.lz
pttbbs-e395b3876b3974723c29e6f92dc305d308ed1e40.tar.xz
pttbbs-e395b3876b3974723c29e6f92dc305d308ed1e40.tar.zst
pttbbs-e395b3876b3974723c29e6f92dc305d308ed1e40.zip
Missed this in last commit
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4122 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
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);