From owner-p4-projects@FreeBSD.ORG Sat Jan 21 14:16:18 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D622B16A479; Sat, 21 Jan 2006 14:16:14 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5319F16A44A for ; Sat, 21 Jan 2006 14:16:14 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17DAD43D49 for ; Sat, 21 Jan 2006 14:16:14 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LEGDgw083622 for ; Sat, 21 Jan 2006 14:16:13 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LEGDYw083619 for perforce@freebsd.org; Sat, 21 Jan 2006 14:16:13 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 14:16:13 GMT Message-Id: <200601211416.k0LEGDYw083619@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90084 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 14:16:18 -0000 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);