mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01: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
2 changed files with 1 additions and 46 deletions
|
@ -60,10 +60,6 @@
|
|||
static char *path[MAX_PATH] = { NULL };
|
||||
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
|
||||
with the -b option. */
|
||||
|
||||
|
@ -177,48 +173,6 @@ FILE *search_path(char *filename, char **fullpath)
|
|||
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 {
|
||||
char *filename;
|
||||
int lineno;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
/* eliminates need to link with libfl */
|
||||
%option noyywrap
|
||||
%option noyy_top_state
|
||||
%option nounput
|
||||
%option stack
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue