diff options
| -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); |
