~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Placate a trivial compiler warning.
[sgt/putty]
/
sshrand.c
diff --git
a/sshrand.c
b/sshrand.c
index
3014da4
..
95c7b49
100644
(file)
--- a/
sshrand.c
+++ b/
sshrand.c
@@
-39,7
+39,7
@@
struct RandPool {
};
static struct RandPool pool;
};
static struct RandPool pool;
-
static
int random_active = 0;
+int random_active = 0;
void random_stir(void)
{
void random_stir(void)
{
@@
-201,7
+201,10
@@
int random_byte(void)
void random_get_savedata(void **data, int *len)
{
void random_get_savedata(void **data, int *len)
{
+ void *buf = smalloc(POOLSIZE / 2);
random_stir();
random_stir();
-
*data = pool.pool + pool.poolpos
;
+
memcpy(buf, pool.pool + pool.poolpos, POOLSIZE / 2)
;
*len = POOLSIZE / 2;
*len = POOLSIZE / 2;
+ *data = buf;
+ random_stir();
}
}