Skip to content

Commit 8028ec4

Browse files
committed
fix again
1 parent 7845991 commit 8028ec4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

qemu/util/guest-random.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
//#include "sysemu/replay.h"
1818
#include <stdlib.h>
1919
#include <string.h>
20+
#include <stdint.h>
2021

2122
#ifndef _MSC_VER
2223
static __thread GRand *thread_rand;
@@ -58,11 +59,11 @@ static int glib_random_bytes(void *buf, size_t len)
5859

5960
for (i = 0; i + 4 <= len; i += 4) {
6061
x = rand();
61-
memcpy(buf + i, &x, 4);
62+
memcpy(((uint8_t*)buf) + i, &x, 4);
6263
}
6364
if (i < len) {
6465
x = rand();
65-
memcpy(buf + i, &x, i - len);
66+
memcpy(((uint8_t*)buf) + i, &x, i - len);
6667
}
6768
}
6869
#endif

0 commit comments

Comments
 (0)