]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
settings: minor code cleanup
authorOlliver Schinagl <oliver@schinagl.nl>
Sun, 27 Sep 2015 13:38:49 +0000 (15:38 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 14 Apr 2016 10:12:15 +0000 (12:12 +0200)
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 <oliver@schinagl.nl>
src/settings.c

index 7ec1cfb5964091c2462340c001bc9c1f1f96d319..22a52152c37aa1f4073f0d49840b1a473525ba1f 100644 (file)
@@ -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);
 }