mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 20:48:07 +00:00
lpconfig.c: fix ISO C90 error
This commit is contained in:
parent
6ac2b798b6
commit
4e974956cb
1 changed files with 11 additions and 9 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue