diff options
author | Inhong Han <inhong1.han@samsung.com> | 2023-08-11 15:35:57 +0900 |
---|---|---|
committer | Jihoon Kim <jihoon48.kim@samsung.com> | 2023-12-22 08:47:25 +0900 |
commit | 081ee8588d700d4eb36a3c5fe808b9f4dfba876d (patch) | |
tree | 7c0c077cdba4503b3d382ca0291db9f76f8f78f8 | |
parent | c6f9a14854790213f3956c14a5d55f89386f1559 (diff) | |
download | libxkbcommon-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.c | 2 | ||||
-rw-r--r-- | test/atom.c | 2 |
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); |