From 56b456a1cc88c5bd0b403efc6d2a6845d6952e2d Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Sun, 27 Sep 2015 15:38:49 +0200 Subject: [PATCH] settings: minor code cleanup Fixes a whitespace issue and puts a variable declaration at the start of its scope rather then mid-scope which can improve portability. Signed-off-by: Olliver Schinagl --- src/settings.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/settings.c b/src/settings.c index 7ec1cfb59..22a52152c 100644 --- a/src/settings.c +++ b/src/settings.c @@ -228,7 +228,7 @@ hts_settings_load_one(const char *filename) /* Open */ if (!(fp = fb_open(filename, 1, 0))) return NULL; size = fb_size(fp); - + /* Load data */ mem = malloc(size+1); n = fb_read(fp, mem, size); @@ -396,6 +396,7 @@ int hts_settings_open_file(int for_write, const char *pathfmt, ...) { char path[PATH_MAX]; + int flags; va_list ap; /* Build path */ @@ -408,7 +409,7 @@ hts_settings_open_file(int for_write, const char *pathfmt, ...) if (hts_settings_makedirs(path)) return -1; /* Open file */ - int flags = for_write ? O_CREAT | O_TRUNC | O_WRONLY : O_RDONLY; + flags = for_write ? O_CREAT | O_TRUNC | O_WRONLY : O_RDONLY; return tvh_open(path, flags, S_IRUSR | S_IWUSR); } -- 2.47.3