From 4e974956cb4644282bb22584baa444f7af6030b7 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 11 May 2015 16:59:50 +0200 Subject: [PATCH] lpconfig.c: fix ISO C90 error --- coreapi/lpconfig.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/coreapi/lpconfig.c b/coreapi/lpconfig.c index d45a199db..d1be24dc7 100644 --- a/coreapi/lpconfig.c +++ b/coreapi/lpconfig.c @@ -720,17 +720,19 @@ static char *_lp_config_dirname(char *path) { } bool_t lp_config_relative_file_exists(const LpConfig *lpconfig, const char *filename) { - if (lpconfig->filename == NULL) + if (lpconfig->filename == NULL) { return FALSE; - char *dir = _lp_config_dirname(lpconfig->filename); - char *filepath = ms_strdup_printf("%s/%s", dir, filename); - FILE *file = fopen(filepath, "r"); - ms_free(dir); - ms_free(filepath); - if (file) { - fclose(file); + } else { + char *dir = _lp_config_dirname(lpconfig->filename); + char *filepath = ms_strdup_printf("%s/%s", dir, filename); + FILE *file = fopen(filepath, "r"); + ms_free(dir); + ms_free(filepath); + if (file) { + fclose(file); + } + return file != NULL; } - return file != NULL; } void lp_config_write_relative_file(const LpConfig *lpconfig, const char *filename, const char *data) {