mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 10:07:12 +00:00
parser: fix warnings about unused functions
Signed-off-by: Eric Chiang <ericchiang@google.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
803cb5558f
commit
2609f356cb
@ -60,10 +60,6 @@
|
|||||||
static char *path[MAX_PATH] = { NULL };
|
static char *path[MAX_PATH] = { NULL };
|
||||||
static int npath = 0;
|
static int npath = 0;
|
||||||
|
|
||||||
static int fgetline(FILE * f, char *buffer, size_t len);
|
|
||||||
static int stripcomment(char *s);
|
|
||||||
static char *stripblanks(char *s);
|
|
||||||
|
|
||||||
/* default base directory is /etc/apparmor.d, it can be overriden
|
/* default base directory is /etc/apparmor.d, it can be overriden
|
||||||
with the -b option. */
|
with the -b option. */
|
||||||
|
|
||||||
@ -177,48 +173,6 @@ FILE *search_path(char *filename, char **fullpath)
|
|||||||
return newf;
|
return newf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get a line from the file. If it is to long truncate it. */
|
|
||||||
static int fgetline(FILE * f, char *buffer, size_t len)
|
|
||||||
{
|
|
||||||
char *b = buffer;
|
|
||||||
int c;
|
|
||||||
|
|
||||||
while (((c = fgetc(f)) != EOF) && (c != '\n')
|
|
||||||
&& (strlen(buffer) < len - 1)) {
|
|
||||||
*b = c;
|
|
||||||
b++;
|
|
||||||
}
|
|
||||||
*b = '\0';
|
|
||||||
if (c != EOF)
|
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If there is a comment null terminate the string,
|
|
||||||
return strlen of the stripped string*/
|
|
||||||
static int stripcomment(char *s)
|
|
||||||
{
|
|
||||||
char *t = s;
|
|
||||||
while (*s != '#' && *s != 0)
|
|
||||||
s++;
|
|
||||||
*s = 0;
|
|
||||||
|
|
||||||
return strlen(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *stripblanks(char *s)
|
|
||||||
{
|
|
||||||
char *c;
|
|
||||||
|
|
||||||
while (isspace(*s))
|
|
||||||
s++;
|
|
||||||
c = s;
|
|
||||||
while (!isspace(*s) && *s != 0)
|
|
||||||
s++;
|
|
||||||
*s = 0;
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct include_stack_t {
|
struct include_stack_t {
|
||||||
char *filename;
|
char *filename;
|
||||||
int lineno;
|
int lineno;
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
/* eliminates need to link with libfl */
|
/* eliminates need to link with libfl */
|
||||||
%option noyywrap
|
%option noyywrap
|
||||||
|
%option noyy_top_state
|
||||||
%option nounput
|
%option nounput
|
||||||
%option stack
|
%option stack
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user