]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/tools.c
Reinstated the use of EUID/UUID in blog posts; however this time they are not being...
[citadel.git] / libcitadel / lib / tools.c
index 4b54981a80b5cbbaf8627181dad50ff7a688b92c..cef6e82b5cd9f5029750b1ea9f00e7288d459ef8 100644 (file)
@@ -874,8 +874,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) ;