1/*-
2 * Copyright (c) 2004, 2009 Apple Inc.
3 * Copyright (c) 2006 Robert N. M. Watson
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
--- 13 unchanged lines hidden (view full) ---
22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 *
30 * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#33 $
31 */
32
33#include <config/config.h>
34
35#include <bsm/libbsm.h>
36
37#include <ctype.h>
38#include <errno.h>
--- 77 unchanged lines hidden (view full) ---
116 if (ferror(fp))
117 return (-1);
118 return (0); /* EOF */
119 }
120
121 if (linestr[0] == '#')
122 continue;
123
124 /* Remove trailing new line character. */
125 if ((nl = strrchr(linestr, '\n')) != NULL)
126 *nl = '\0';
127
128 tokptr = linestr;
129 if ((type = strtok_r(tokptr, delim, &last)) != NULL) {
130 if (strcmp(name, type) == 0) {
131 /* Found matching name. */
132 *str = strtok_r(NULL, delim, &last);
133 if (*str == NULL) {
134 errno = EINVAL;
--- 608 unchanged lines hidden ---
2 * Copyright (c) 2004, 2009 Apple Inc.
3 * Copyright (c) 2006 Robert N. M. Watson
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
--- 13 unchanged lines hidden (view full) ---
22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 *
30 * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#33 $
31 */
32
33#include <config/config.h>
34
35#include <bsm/libbsm.h>
36
37#include <ctype.h>
38#include <errno.h>
--- 77 unchanged lines hidden (view full) ---
116 if (ferror(fp))
117 return (-1);
118 return (0); /* EOF */
119 }
120
121 if (linestr[0] == '#')
122 continue;
123
124 /* Remove trailing new line character. */
125 if ((nl = strrchr(linestr, '\n')) != NULL)
126 *nl = '\0';
127
128 tokptr = linestr;
129 if ((type = strtok_r(tokptr, delim, &last)) != NULL) {
130 if (strcmp(name, type) == 0) {
131 /* Found matching name. */
132 *str = strtok_r(NULL, delim, &last);
133 if (*str == NULL) {
134 errno = EINVAL;
--- 608 unchanged lines hidden ---