if (cur_state < 0 || cur_state > STATE_QUIT) {
if (cur_state < 0 || cur_state > STATE_RUN) {
test_state(int action, int next){	if (cur_state < 0 || cur_state > STATE_QUIT) {		logmsg(LOG_ERR, "[priv] Invalid state: %d", cur_state);		_exit(1);	}	if ((allowed_max[cur_state] & allowed_ext[cur_state]	    & ALLOW(action)) == 0) {		logmsg(LOG_ERR, "[priv] Invalid action %d in state %d",		    action, cur_state);		_exit(1);	}	if (next < cur_state) {		logmsg(LOG_ERR, "[priv] Invalid next state: %d < %d",		    next, cur_state);		_exit(1);	}	cur_state = next;}