mirror of https://github.com/ideawu/c1000k
Fix if statement for argument count
Otherwise you would have to provide a second "fake" argument to properly set the desired port range.
This commit is contained in:
parent
6c6f92fec3
commit
3f37b2b6d1
4
server.c
4
server.c
|
|
@ -28,7 +28,7 @@ int main(int argc, char **argv){
|
||||||
socklen_t optlen;
|
socklen_t optlen;
|
||||||
int connections = 0;
|
int connections = 0;
|
||||||
int base_port = 7000;
|
int base_port = 7000;
|
||||||
if(argc > 2){
|
if(argc >= 2){
|
||||||
base_port = atoi(argv[1]);
|
base_port = atoi(argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -110,5 +110,3 @@ sock_err:
|
||||||
printf("error: %s\n", strerror(errno));
|
printf("error: %s\n", strerror(errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue