rfbLog("bad action line: %s\n", action);
rfbLogEnable(1); rfbLog("invalid action line: %s\n", action);
static int action_match(char *action, int rc) {	char *p, *q, *s = strdup(action);	int cases[4], i, result;	char *labels[4];	labels[1] = "yes";	labels[2] = "no";	labels[3] = "view";	rfbLog("accept_client: process action line: %s\n",	    action);	for (i=1; i <= 3; i++) {		cases[i] = -2;	}	p = strtok(s, ",");	while (p) {		if ((q = strchr(p, ':')) != NULL) {			int in, k;			*q = '\0';			q++;			if (strstr(p, "yes") == p) {				k = 1;			} else if (strstr(p, "no") == p) {				k = 2;			} else if (strstr(p, "view") == p) {				k = 3;			} else {				rfbLog("bad action line: %s\n", action);				clean_up_exit(1);			}			if (*q == '*') {				cases[k] = -1;			} else if (sscanf(q, "%d", &in) == 1) {				if (in < 0) {					rfbLog("bad action line: %s\n", action);					clean_up_exit(1);				}				cases[k] = in;			} else {				rfbLog("bad action line: %s\n", action);				clean_up_exit(1);			}		} else {			rfbLog("bad action line: %s\n", action);			clean_up_exit(1);		}		p = strtok(NULL, ",");	}	free(s);	result = -1;	for (i=1; i <= 3; i++) {		if (cases[i] == -1) {			rfbLog("accept_client: default action is case=%d %s\n",			    i, labels[i]);			result = i;			break;		}	}	if (result == -1) {		rfbLog("accept_client: no default action\n");	}	for (i=1; i <= 3; i++) {		if (cases[i] >= 0 && cases[i] == rc) {			rfbLog("accept_client: matched action is case=%d %s\n",			    i, labels[i]);			result = i;			break;		}	}	if (result < 0) {		rfbLog("no action match: %s rc=%d set to no\n", action, rc);		result = 2;	}	return result;}