if ((logentry.cmd[0] =='K' || logentry.cmd[0] == 'S') && ( 30 <= logentry.cmd[1] <= 39 ) && ( 30 <= logentry.cmd[2] <= 39 ) )
if ((logentry.cmd[0] =='K' || logentry.cmd[0] == 'S') && ( logentry.cmd[1] >= '0' && logentry.cmd[1] <= '9' ) && ( logentry.cmd[2] >= '0' && logentry.cmd[2] <= '9' ) )
int logEvent(char *cmd, int eventtype,char *string) {    char *eventtable [] = {	_("%s babbles incoherently"),	_("%s succeeded"),	_("%s failed"),	_("%s cancelled at user request"),	_("%s failed due to a failed dependency"),	/* insert more here */	NULL    };    int x=0,len;    struct logInfo logentry;        if (cmd) {	logentry.cmd = strdup(basename(cmd));	if ((logentry.cmd[0] =='K' || logentry.cmd[0] == 'S') && ( 30 <= logentry.cmd[1] <= 39 )	    && ( 30 <= logentry.cmd[2] <= 39 ) )	  logentry.cmd+=3;    } else      logentry.cmd = strdup(_("(none)"));    if (!string)      string = strdup(cmd);        while (eventtable[x] && x<eventtype) x++;    if (!(eventtable[x])) x=0;        len=strlen(eventtable[x])+strlen(string);    logentry.line=malloc(len);    snprintf(logentry.line,len,eventtable[x],string);        logentry.pri = logpriority;    logentry.fac = logfacility;        return logLine(&logentry);}