uav_electronic_ids icon indicating copy to clipboard operation
uav_electronic_ids copied to clipboard

Around line 497

Open Greg-C10 opened this issue 7 months ago • 0 comments

I was having an issue with positions in the uav array resetting. Found that msecs was greater then uavs[i].last_seen. Since these are unsigned, what would have been negative result rolls back to the max - ??. Therefore whenever msecs> uavs[i].last_seen, it always produces a true result. In my case it was somewhere around a few negative milliseconds. But the result was my array positions were being overwritten and open for use. I made the following changes. Probably need to check other areas where that could happen.

Before:

if ((uavs[i].last_seen)&& ((msecs - uavs[i].last_seen) > 300000L)) {

After:

if ((uavs[i].last_seen) && (msecs > uavs[i].last_seen) && ((msecs - uavs[i].last_seen) > 300000L))

Greg-C10 avatar Jul 23 '24 20:07 Greg-C10