diff options
| author | Jesper Jensen <jesper@jnsn.dev> | 2025-04-15 14:48:55 +0200 |
|---|---|---|
| committer | Jesper Jensen <jesper@jnsn.dev> | 2025-04-15 14:48:55 +0200 |
| commit | 78a6d2ec1fb9c61cda1a8bcdc3843b159cdd850c (patch) | |
| tree | 2888ca6f4810c8e289572a645aa235a219f24c83 /src | |
| parent | 6386a3eb9628315e23e16637ea5d29e72b053f0f (diff) | |
Reformat target generation
I think this reads nicer
Diffstat (limited to 'src')
| -rw-r--r-- | src/routing.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/routing.c b/src/routing.c index eca84f9..edffffc 100644 --- a/src/routing.c +++ b/src/routing.c @@ -136,8 +136,9 @@ static uint8_t rand_byte() { struct nodeid rand_nodeid_in_bucket(struct nodeid *self, struct nodeid *other) { struct nodeid target; - for(uint8_t *target_byte = (uint8_t*)⌖ target_byte < ((uint8_t*)&target)+sizeof(target); target_byte++) { - *target_byte = rand_byte(); + { + char *target_byte = (char*)⌖ + for(size_t i = 0; i < sizeof(target); i++) (*target_byte++) = rand_byte(); } uint8_t bucket = prefix(self, other); |
