- bug in protocol arg handling

This commit is contained in:
zolliker
2008-06-17 09:27:00 +00:00
parent 2abf75271b
commit 7c2504bdc2

View File

@ -132,7 +132,7 @@ int AsconStdInit(Ascon *a, SConnection *con,
a->state = AsconConnectStart;
a->reconnectInterval = 10;
a->hostport = strdup(argv[1]);
if(argc < 2){
if(argc > 2){
a->sendTerminator = strdup(argv[2]);
} else {
a->sendTerminator = strdup("\n");
@ -374,7 +374,7 @@ AsconHandler AsconSetHandler(Ascon *a, SConnection *con,
if (argc < 1) return NULL;
if (strcasecmp(argv[0], "std") == 0) {
if (argc != 2) return NULL;
if (argc < 2) return NULL;
AsconStdInit(a, con, argc, argv);
return AsconStdHandler;
}