Mercurial > pidgin.yaz
changeset 12422:fe42d9c111f9
[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 <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Thu, 08 Dec 2005 23:28:11 +0000 |
parents | f71d6b79ec81 |
children | 692467ea6244 |
files | src/protocols/sametime/sametime.c |
diffstat | 1 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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); }