summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInhong Han <inhong1.han@samsung.com>2023-08-11 15:35:57 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2023-12-22 08:47:25 +0900
commit081ee8588d700d4eb36a3c5fe808b9f4dfba876d (patch)
tree7c0c077cdba4503b3d382ca0291db9f76f8f78f8
parentc6f9a14854790213f3956c14a5d55f89386f1559 (diff)
downloadlibxkbcommon-081ee8588d700d4eb36a3c5fe808b9f4dfba876d.tar.gz
libxkbcommon-081ee8588d700d4eb36a3c5fe808b9f4dfba876d.tar.bz2
libxkbcommon-081ee8588d700d4eb36a3c5fe808b9f4dfba876d.zip
Fix issue detected by static analysis tool
Change-Id: I67e4520bcac592600ad83e6060e2499620d20359
-rw-r--r--bench/key-proc.c2
-rw-r--r--test/atom.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/bench/key-proc.c b/bench/key-proc.c
index 1d29243..13f1b55 100644
--- a/bench/key-proc.c
+++ b/bench/key-proc.c
@@ -39,6 +39,8 @@ bench_key_proc(struct xkb_state *state)
xkb_keysym_t keysym;
int i;
+ srand((unsigned) time(NULL));
+
for (i = 0; i < BENCHMARK_ITERATIONS; i++) {
keycode = (rand() % (255 - 9)) + 9;
if (keys[keycode]) {
diff --git a/test/atom.c b/test/atom.c
index a2f7541..d42d451 100644
--- a/test/atom.c
+++ b/test/atom.c
@@ -45,6 +45,8 @@ random_string(char **str_out, size_t *len_out)
size_t len;
char *str;
+ srand((unsigned) time(NULL));
+
len = rand() % 15;
str = malloc(len + 1);
assert(str);