From 85eafb57df113cf85164120def1b6c42f894823c Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Thu, 16 Jan 2025 01:29:04 +0900
Subject: [PATCH 1095/1160] 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
```
(cherry picked from commit e722fe74ca5e00d3c8a5f85342b75c40ace051f9)
(cherry picked from commit 8f2f04b7d4ce80d9908f93e9cb458c9e92b19108)
(cherry picked from commit 57d2446acdaa668e3a24489aa197d4672fce2197)
src/basic/random-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -44,7 +44,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),
@@ -52,6 +51,7 @@ static void fallback_random_bytes(void *p, size_t n) {
.tid = gettid(),
};
+ memcpy(state.label, "systemd fallback random bytes v1", sizeof(state.label));
#if HAVE_SYS_AUXV_H
memcpy(state.auxval, ULONG_TO_PTR(getauxval(AT_RANDOM)), sizeof(state.auxval));
#endif
--
2.33.0