From: Olliver Schinagl Date: Sun, 27 Sep 2015 13:38:49 +0000 (+0200) Subject: settings: minor code cleanup X-Git-Tag: v4.2.1~654 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=56b456a1cc88c5bd0b403efc6d2a6845d6952e2d;p=thirdparty%2Ftvheadend.git 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 --- 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); }