poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Set the random seed when .jmd is called for the first time


From: Jose E. Marchesi
Subject: Re: [PATCH] Set the random seed when .jmd is called for the first time
Date: Fri, 21 Feb 2020 18:58:40 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

OK for master.
;)

    ---
     ChangeLog     | 5 +++++
     src/pk-misc.c | 2 ++
     2 files changed, 7 insertions(+)
    
    diff --git a/ChangeLog b/ChangeLog
    index 173308bb..4c61b8e6 100644
    --- a/ChangeLog
    +++ b/ChangeLog
    @@ -1,3 +1,8 @@
    +2020-02-16  John Darrington <address@hidden>
    +
    +   * src/pk-misc (pk_cmd_jmd): Set the random seed the first
    +   time this function is called.
    +
     2020-02-16  John Darrington <address@hidden>
     
        * src/pk-ios.c (close_completion_function): rename to
    diff --git a/src/pk-misc.c b/src/pk-misc.c
    index ab14b8ce..cd0fc6c3 100644
    --- a/src/pk-misc.c
    +++ b/src/pk-misc.c
    @@ -18,6 +18,7 @@
     
     #include <config.h>
     #include <assert.h>
    +#include <time.h>
     
     #include "poke.h"
     #include "pk-cmd.h"
    @@ -83,6 +84,7 @@ pk_cmd_jmd (int argc, struct pk_cmd_arg argv[], uint64_t 
uflags)
     
       if (num_strings == 0)
         {
    +      srand (time (NULL));
           char **p = strings;
           while (*p++ != NULL)
             num_strings++;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]