X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor-pkg-ubuntu.git;a=blobdiff_plain;f=src%2Flib%2Fslog.c;h=5b165263bd6742c4286d52e80704ed94397f4607;hp=15ccd0b8ddd8b2e854c47095cc9d39b3cdc48013;hb=5c1e07fec97e34a94331b6b47e25c98f2b2e4cce;hpb=4c50d430bea4b8462b0ae7ab70baf3f538f87718 diff --git a/src/lib/slog.c b/src/lib/slog.c index 15ccd0b..5b16526 100644 --- a/src/lib/slog.c +++ b/src/lib/slog.c @@ -58,12 +58,11 @@ static char *time_to_str(time_t *t) str = malloc(64); - if (strftime(str, 64, "%s", <)) { + if (strftime(str, 64, "%s", <)) return str; - } else { - free(str); - return NULL; - } + + free(str); + return NULL; } static char *get_default_path() @@ -83,10 +82,10 @@ static char *get_default_path() free(dir); return path; - } else { - log_warn(_("HOME variable not set.")); - return strdup(DEFAULT_FILENAME); } + + log_warn(_("HOME variable not set.")); + return strdup(DEFAULT_FILENAME); } static bool slog_open(const char *path, struct psensor **sensors) @@ -135,7 +134,7 @@ static void slog_write_sensors(struct psensor **sensors) if (!file) { log_debug(_("Sensor log file not open.")); - return ; + return; } gettimeofday(&tv, NULL);