]> git.tuebingen.mpg.de Git - dss.git/blobdiff - snap.c
Fix off-by-one bug in find_outdated_snapshot().
[dss.git] / snap.c
diff --git a/snap.c b/snap.c
index 89d6004b6cb1731a73583d0d4ac07b469b3db916..1ff5fd7848e079f9cc954a03316bf8e0f4ae274b 100644 (file)
--- a/snap.c
+++ b/snap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2008-2009 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -101,7 +101,7 @@ static int is_snapshot(const char *dirname, int64_t now, int unit_interval,
        free(tmp);
        if (ret < 0)
                return 0;
-       if (num > now)
+       if (num > now || num < s->creation_time)
                return 0;
        s->completion_time = num;
        s->flags = SS_COMPLETE;