From 9738406414f3a056286d8298c4200af2211d3ae2 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 9 Dec 2021 17:13:55 +0000 Subject: [PATCH] Fix db id generation in case of clock discontinuity. Thanks to Rebecca Gellman. --- src/database.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database.c b/src/database.c index e7658378..e1a443f0 100644 --- a/src/database.c +++ b/src/database.c @@ -902,7 +902,7 @@ uint64_t db__new_msg_id(void) tmp = (nsec & 0x7FFFFF80); /* top 23-bits of the bottom 30 bits (1 billion ns), ~100 ns resolution */ id = id | (tmp >> 7); - while(id <= db.last_db_id){ + if(id <= db.last_db_id){ id++; } db.last_db_id = id;