[gaim-migrate @ 14729]

Thu, 08 Dec 2005 23:28:11 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Thu, 08 Dec 2005 23:28:11 +0000
changeset 12422
53fba178cadf
parent 12421
026806fcaf4e
child 12423
e83c899d3be9

[gaim-migrate @ 14729]
Make user_supports_text static. Rework im_mime_content_id() and im_mime_content_type(): time() takes a pointer. srand(time(NULL) ^ rand()) probably isn't any better than srand(time(NULL))

src/protocols/sametime/sametime.c file | annotate | diff | comparison | revisions
--- a/src/protocols/sametime/sametime.c	Thu Dec 08 22:27:29 2005 +0000
+++ b/src/protocols/sametime/sametime.c	Thu Dec 08 23:28:11 2005 +0000
@@ -3255,7 +3255,7 @@
 }
 
 
-char *user_supports_text(struct mwServiceAware *srvc, const char *who) {
+static char *user_supports_text(struct mwServiceAware *srvc, const char *who) {
     char *feat[] = {NULL, NULL, NULL, NULL, NULL};
     char **f = feat;
 
@@ -3738,18 +3738,17 @@
 
 /** generates a random-ish content id string */
 static char *im_mime_content_id() {
-  const char *c = "%03x@%05xmeanwhile";
-  srand(time(0) ^ rand());
-  return g_strdup_printf(c, rand() & 0xfff, rand() & 0xfffff);
+  srand(time(NULL));
+  return g_strdup_printf("%03x@%05xmeanwhile", rand() & 0xfff, rand() & 0xfffff);
 }
 
 
 /** generates a multipart/related content type with a random-ish
     boundary value */
 static char *im_mime_content_type() {
-  const char *c = "multipart/related; boundary=related_MW%03x_%04x";
-  srand(time(0) ^ rand());
-  return g_strdup_printf(c, rand() & 0xfff, rand() & 0xffff);
+  srand(time(NULL));
+  return g_strdup_printf("multipart/related; boundary=related_MW%03x_%04x",
+                         rand() & 0xfff, rand() & 0xffff);
 }
 
 

mercurial