From 78a6d2ec1fb9c61cda1a8bcdc3843b159cdd850c Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Tue, 15 Apr 2025 14:48:55 +0200 Subject: Reformat target generation I think this reads nicer --- src/routing.c | 5 +++-- 1 file 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); -- cgit v1.2.3