From c74d73cfe5fdab083eb6b474fcdcc9f9fda5351c Mon Sep 17 00:00:00 2001 From: Memphis Date: Wed, 13 May 2015 20:35:29 +0200 Subject: [PATCH] - use atomic_dec_u64 for decrementing size counters - this prevents an unsigned wrap because of casting negative parameter to uint64_t - fixes #2712 --- src/timeshift/timeshift_filemgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/timeshift/timeshift_filemgr.c b/src/timeshift/timeshift_filemgr.c index 04c6ea0a7..de4e21f45 100644 --- a/src/timeshift/timeshift_filemgr.c +++ b/src/timeshift/timeshift_filemgr.c @@ -180,9 +180,9 @@ void timeshift_filemgr_remove tvhdebug("timeshift", "ts %d RAM segment remove time %li", ts->id, (long)tsf->time); #endif TAILQ_REMOVE(&ts->files, tsf, link); - atomic_add_u64(×hift_total_size, -tsf->size); + atomic_dec_u64(×hift_total_size, tsf->size); if (tsf->ram) - atomic_add_u64(×hift_total_ram_size, -tsf->size); + atomic_dec_u64(×hift_total_ram_size, tsf->size); timeshift_reaper_remove(tsf); } -- 2.47.2