You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the function vlan_find_or_add_room, in the case of case 0, we insert a new meta data. Shouldn't we insert from the end to the beginning?"
original code:
case 0: // merge none
// insert into meta list
arr->nummeta++;
arr->meta = realloc(arr->meta, arr->nummeta * sizeof(*arr->meta));
assert(arr->meta);
for (uint16_t i = succ; i < arr->nummeta - 1; i++)
arr->meta[i+1] = arr->meta[i];
arr->meta[succ].offset = startoffset;
arr->meta[succ].start = vid / 16;
return succ;
The code should be changed to
for (uint16_t i = arr->nummeta - 1; i > succ; i--) {
arr->meta[i] = arr->meta[i - 1];
}
The text was updated successfully, but these errors were encountered:
In the function
vlan_find_or_add_room
, in the case ofcase 0
, we insert a new meta data. Shouldn't we insert from the end to the beginning?"original code:
The code should be changed to
The text was updated successfully, but these errors were encountered: