aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-08-04 10:31:20 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-08-04 10:31:20 +0000
commita8951213805924a73114984e43d50899cefb6f4d (patch)
tree7f825215d5c0c965e21b98de69afe41e466700c4 /src/utils.c
parent8e645104879753898e43fa707fffe31ee5a2c3bf (diff)
replaced random() with g_random_*().
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@464 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/utils.c b/src/utils.c
index 6463698a..fb021df9 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -2715,18 +2715,9 @@ gchar *generate_mime_boundary(const gchar *prefix)
gchar buf_uniq[17];
gchar buf_date[64];
gint i;
- gint pid;
- pid = getpid();
-
- /* We make the boundary depend on the pid, so that all running
- * processes generate different values even when they have been
- * started within the same second and srandom(time(NULL)) has been
- * used. I can't see whether this is really an advantage but it
- * doesn't do any harm.
- */
for (i = 0; i < sizeof(buf_uniq) - 1; i++)
- buf_uniq[i] = tbl[(random() ^ pid) % (sizeof(tbl) - 1)];
+ buf_uniq[i] = tbl[g_random_int_range(0, sizeof(tbl) - 1)];
buf_uniq[i] = '\0';
get_rfc822_date(buf_date, sizeof(buf_date));