From: Heiko Voigt Date: Tue, 26 Feb 2013 19:40:23 GMT Subject: [PATCH 2/4] config: drop file pointer validity check in get_next_char() Message-ID: <20130226194023.GC22756@sandbox-ub> In-Reply-To: <20130226193050.GA22756@sandbox-ub> The only location where cf is set in this file is in do_config_from(). This function has only one callsite which is config_from_file(). In config_from_file() its ensured that the f member is set to non-zero. Signed-off-by: Heiko Voigt --- config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index 2c299dc..f55c43d 100644 --- a/config.c +++ b/config.c @@ -169,10 +169,10 @@ int git_config_from_parameters(config_fn_t fn, void *data) static int get_next_char(void) { int c; - FILE *f; c = '\n'; - if (cf && ((f = cf->f) != NULL)) { + if (cf) { + FILE *f = cf->f; c = fgetc(f); if (c == '\r') { /* DOS like systems */ -- 1.8.2.rc0.26.gf7384c5