X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Flib%2Ftools.c;h=0c012e7955e184d128b589ad547b1bf645ebb767;hb=eb75382b7eb4a6017edb726ea54d6d5ae6286f86;hp=db8fe3af8f2809f79c1b78808c86bd547a18d7fd;hpb=0208b0712f1023615d402e6ebccbf8dc96b710fd;p=citadel.git diff --git a/libcitadel/lib/tools.c b/libcitadel/lib/tools.c index db8fe3af8..0c012e795 100644 --- a/libcitadel/lib/tools.c +++ b/libcitadel/lib/tools.c @@ -858,8 +858,11 @@ char *strcpy(char *dest, const char *src) { * Generate a new, globally unique UID parameter for a calendar etc. object */ void generate_uuid(char *buf) { - static int seq = 0; + static int seq = (-1); + if (seq == (-1)) { + seq = (int)rand(); + } ++seq; seq = (seq % 0x0FFF) ;