# HG changeset patch # User Richard Laager # Date 1134084491 0 # Node ID fe42d9c111f9a92f519961615380c87de41c39a7 # Parent f71d6b79ec810965dfca59d4902ec0deeab24fc9 [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)) committer: Tailor Script diff -r f71d6b79ec81 -r fe42d9c111f9 src/protocols/sametime/sametime.c --- 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); }