From: Masahiro Yamada Date: Thu, 11 Jan 2018 13:39:40 +0000 (+0900) Subject: kconfig: make xfgets() really static X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=155c0b0aac714c34f336050db7d3c1a708dad1e3;p=carl9170fw.git kconfig: make xfgets() really static 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 Signed-off-by: Christian Lamparter --- diff --git a/config/conf.c b/config/conf.c index 7c2b7a7..06ddb05 100644 --- a/config/conf.c +++ b/config/conf.c @@ -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, @@ -81,6 +80,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); @@ -668,12 +674,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"); -}