Skip to content

Commit

Permalink
Update xkcp_spy.c
Browse files Browse the repository at this point in the history
  • Loading branch information
liudf0716 authored Apr 19, 2017
1 parent b465650 commit 45f1427
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion xkcp_spy.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ int main(int argc, char **argv)
struct event_base *base;
struct bufferevent *bev;
char *cmd = NULL, *addr = NULL, *param = NULL;
int port = 0, opt;
int port = 0, opt, flag = 1;

while((opt = getopt(argc, argv, "h:p:t:m:")) != -1) {
flag = 0;

switch(opt) {
case 'h':
addr = strdup(optarg);
Expand All @@ -103,6 +105,11 @@ int main(int argc, char **argv)
}
}

if (flag) {
usage();
exit(EXIT_FAILURE);
}

base = event_base_new();
if (!base) {
puts("Couldn't open event base");
Expand Down

0 comments on commit 45f1427

Please sign in to comment.