Make the entity id a smaller string
authorMikael Berthe <mikael@lilotux.net>
Tue, 08 May 2007 11:04:32 +0200
changeset 1217 21226969d59a
parent 1216 8645b5166040
child 1218 ab5de2ed2b7e
Make the entity id a smaller string
mcabber/src/jab_iq.c
--- a/mcabber/src/jab_iq.c	Tue May 08 10:14:57 2007 +0200
+++ b/mcabber/src/jab_iq.c	Tue May 08 11:04:32 2007 +0200
@@ -130,7 +130,7 @@
   if (!ver) {
     unsigned int n;
     srand(time(NULL));
-    n = (1U + (unsigned int)rand()) >> 8;
+    n = (unsigned int)(10.0 + 6.0 * rand() / (RAND_MAX + 1.0));
     ver = g_strdup_printf("%s~%x", tver, n);
     g_free(tver);
   }