diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compose.c | 2 | ||||
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/procmsg.c | 3 | ||||
-rw-r--r-- | src/utils.c | 11 |
4 files changed, 3 insertions, 15 deletions
diff --git a/src/compose.c b/src/compose.c index fd3b3fa7..eca3aba2 100644 --- a/src/compose.c +++ b/src/compose.c @@ -3788,7 +3788,7 @@ static void compose_generate_msgid(Compose *compose, gchar *buf, gint len) lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec, - (guint)random(), addr); + g_random_int(), addr); debug_print(_("generated Message-ID: %s\n"), buf); @@ -185,8 +185,6 @@ int main(int argc, char *argv[]) ssl_init(); #endif - srandom((gint)time(NULL)); - /* parse gtkrc files */ userrc = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, ".gtkrc-2.0", NULL); diff --git a/src/procmsg.c b/src/procmsg.c index fb7c0fd4..0a5ebe31 100644 --- a/src/procmsg.c +++ b/src/procmsg.c @@ -1276,8 +1276,7 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs, } g_snprintf(tmp, sizeof(tmp), "%s%ctmpmsg.out.%08x", - get_rc_dir(), G_DIR_SEPARATOR, - (guint)random()); + get_rc_dir(), G_DIR_SEPARATOR, g_random_int()); if (send_get_queue_contents(qinfo, tmp) == 0) { if (save_msgs) { 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)); |