#include <readline.h>\r
#include <string.h>\r
\r
-#define BUFSIZ 128\r
+#define BUFSIZ 2048\r
\r
// === PROTOTYPES ===\r
int main(int argc, char *argv[], char *envp[]);\r
int client_running = 1;\r
int bUseReadline = !!argv[3]; // HACK: If third argument is present, use ReadLine\r
tReadline *readline_info;\r
+ int port;\r
+ \r
+ if( argc < 2 || argc > 3 ) {\r
+ fprintf(stderr, "Usage: telnet <host> [<port>]\n Port defaults to 23\n");\r
+ return 0;\r
+ }\r
+ \r
+ if(argc == 3)\r
+ port = atoi(argv[2]);\r
+ else\r
+ port = 23;\r
\r
// Connect to the remove server\r
- server_fd = OpenTCP( argv[1], atoi(argv[2]) );\r
+ server_fd = OpenTCP( argv[1], port );\r
if( server_fd == -1 ) {\r
fprintf(stderr, "Unable to create socket\n");\r
return -1;\r