Fixed usage of 8-bit modulo operator off-by-one maximum. (#901)
This commit is contained in:
@@ -97,7 +97,7 @@ void bsc_generate_random_vmac(BACNET_SC_VMAC_ADDRESS *p)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < BVLC_SC_VMAC_SIZE; i++) {
|
||||
p->address[i] = rand() % 255;
|
||||
p->address[i] = rand() % 256;
|
||||
if (i == 0) {
|
||||
/* According H.7.3 EUI-48 and Random-48 VMAC Address:
|
||||
The Random-48 VMAC is a 6-octet VMAC address in which the least
|
||||
@@ -120,7 +120,7 @@ void bsc_generate_random_uuid(BACNET_SC_UUID *p)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < BVLC_SC_UUID_SIZE; i++) {
|
||||
p->uuid[i] = rand() % 255;
|
||||
p->uuid[i] = rand() % 256;
|
||||
}
|
||||
debug_printf_hex(0, p->uuid, BVLC_SC_UUID_SIZE, "bsc_generate_random_uuid");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user