From b592ac3cb7717f874598e2ae3413fe15167acc62 Mon Sep 17 00:00:00 2001 From: Nedko Arnaudov Date: Tue, 11 Oct 2011 01:24:53 +0300 Subject: [PATCH] fix compiler warning --- common/dirhelpers.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/dirhelpers.c b/common/dirhelpers.c index b5e01b2b..09e06369 100644 --- a/common/dirhelpers.c +++ b/common/dirhelpers.c @@ -330,7 +330,10 @@ bool ladish_rotate(const char * src, const char * dst, unsigned int max_backups) bool oldest_found; unsigned int backup; + ASSERT(max_backups > 0); + oldest_found = false; + path = NULL; older_path = NULL; backup = max_backups; while (backup > 0) @@ -383,6 +386,8 @@ bool ladish_rotate(const char * src, const char * dst, unsigned int max_backups) backup--; } + ASSERT(path != NULL); + log_info("rename '%s' -> '%s'", dst, path); if (rename(dst, path) != 0 && errno != ENOENT) {