Date: Sat, 21 Jan 2006 14:16:13 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 90084 for review Message-ID: <200601211416.k0LEGDYw083619@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=90084 Change 90084 by rwatson@rwatson_sesame on 2006/01/21 14:15:54 Constify delimiter for class file, no need to make it a variable to the parsing function. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#8 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#8 (text+ko) ==== @@ -39,9 +39,9 @@ * Parse the contents of the audit_class file to return struct au_class_ent * entries. */ -static FILE *fp = NULL; -static char linestr[AU_LINE_MAX]; -static char *delim = ":"; +static FILE *fp = NULL; +static char linestr[AU_LINE_MAX]; +static const char *classdelim = ":"; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -50,15 +50,15 @@ * au_class_ent elements; store the result in c. */ static struct au_class_ent * -classfromstr(char *str, char *delim, struct au_class_ent *c) +classfromstr(char *str, struct au_class_ent *c) { char *classname, *classdesc, *classflag; char *last; /* Each line contains flag:name:desc. */ - classflag = strtok_r(str, delim, &last); - classname = strtok_r(NULL, delim, &last); - classdesc = strtok_r(NULL, delim, &last); + classflag = strtok_r(str, classdelim, &last); + classname = strtok_r(NULL, classdelim, &last); + classdesc = strtok_r(NULL, classdelim, &last); if ((classflag == NULL) || (classname == NULL) || (classdesc == NULL)) return (NULL); @@ -113,7 +113,7 @@ tokptr = linestr; /* Parse tokptr to au_class_ent components. */ - if (classfromstr(tokptr, delim, c) == NULL) + if (classfromstr(tokptr, c) == NULL) return (NULL); return (c);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601211416.k0LEGDYw083619>