diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2025-01-15 17:29:04 +0100 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2025-01-15 20:24:30 +0100 |
commit | e722fe74ca5e00d3c8a5f85342b75c40ace051f9 (patch) | |
tree | b52805718739bb3ba41fcca879cf07a83a99f4c2 /src/basic/random-util.c | |
parent | userdb: optionally parse numeric UIDs/GIDs where a username is expected (diff) | |
download | systemd-e722fe74ca5e00d3c8a5f85342b75c40ace051f9.tar.xz systemd-e722fe74ca5e00d3c8a5f85342b75c40ace051f9.zip |
random-util: fix compilation error
Fixes the following error:
```
../src/basic/random-util.c: In function "fallback_random_bytes":
../src/basic/random-util.c:45:26: error: initializer-string for array of "char" is too long [-Werror=unterminated-string-initialization]
45 | .label = "systemd fallback random bytes v1",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```
Diffstat (limited to '')
-rw-r--r-- | src/basic/random-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/random-util.c b/src/basic/random-util.c index 02713859f0..866f0ba5ed 100644 --- a/src/basic/random-util.c +++ b/src/basic/random-util.c @@ -42,7 +42,6 @@ static void fallback_random_bytes(void *p, size_t n) { uint8_t auxval[16]; } state = { /* Arbitrary domain separation to prevent other usage of AT_RANDOM from clashing. */ - .label = "systemd fallback random bytes v1", .call_id = fallback_counter++, .stamp_mono = now(CLOCK_MONOTONIC), .stamp_real = now(CLOCK_REALTIME), @@ -50,6 +49,7 @@ static void fallback_random_bytes(void *p, size_t n) { .tid = gettid(), }; + memcpy(state.label, "systemd fallback random bytes v1", sizeof(state.label)); memcpy(state.auxval, ULONG_TO_PTR(getauxval(AT_RANDOM)), sizeof(state.auxval)); while (n > 0) { |