Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 <oliver@schinagl.nl>
  • Loading branch information
oliv3r authored and perexg committed Apr 14, 2016
1 parent d931020 commit 56b456a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/settings.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand All @@ -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);
}
Expand Down

0 comments on commit 56b456a

Please sign in to comment.