Skip to content

Commit

Permalink
kconfig: make xfgets() really static
Browse files Browse the repository at this point in the history
Sparse reports:
  warning: symbol 'xfgets' was not declared. Should it be static?

It is declared as static, but it is missing in the definition part.
Move the definition up and remove the forward declaration.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
  • Loading branch information
masahir0y committed Jan 21, 2018
1 parent 52e58a3 commit 5a3dc71
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

static void conf(struct menu *menu);
static void check_conf(struct menu *menu);
static void xfgets(char *str, int size, FILE *in);

enum input_mode {
oldaskconfig,
Expand Down Expand Up @@ -83,6 +82,13 @@ static void check_stdin(void)
}
}

/* Helper function to facilitate fgets() by Jean Sacren. */
static void xfgets(char *str, int size, FILE *in)
{
if (!fgets(str, size, in))
fprintf(stderr, "\nError in reading or end of file.\n");
}

static int conf_askvalue(struct symbol *sym, const char *def)
{
enum symbol_type type = sym_get_type(sym);
Expand Down Expand Up @@ -713,12 +719,3 @@ int main(int ac, char **av)
}
return 0;
}

/*
* Helper function to facilitate fgets() by Jean Sacren.
*/
void xfgets(char *str, int size, FILE *in)
{
if (fgets(str, size, in) == NULL)
fprintf(stderr, "\nError in reading or end of file.\n");
}

0 comments on commit 5a3dc71

Please sign in to comment.