forked from rosebudai/OpenRCT2-Web
Merge pull request #4413 from janisozaur/fixes
* Make sure shifted value is unsigned * Guard against passing NULL to qsort()
This commit is contained in:
commit
70d35e91fb
2 files changed
+4
-1
No files matched your search
+1
-1
@@ -610,7 +610,7 @@ bool staff_is_patrol_area_set(int staffIndex, int x, int y)
|
||||
int peepOffset = staffIndex * 128;
|
||||
int offset = (x | y) >> 5;
|
||||
int bitIndex = (x | y) & 0x1F;
|
||||
return gStaffPatrolAreas[peepOffset + offset] & (1 << bitIndex);
|
||||
return gStaffPatrolAreas[peepOffset + offset] & (((uint32)1) << bitIndex);
|
||||
}
|
||||
|
||||
void staff_set_patrol_area(int staffIndex, int x, int y, bool value)
|
||||
|
||||
@@ -695,6 +695,9 @@ static int server_compare(const void *a, const void *b)
|
||||
|
||||
static void sort_servers()
|
||||
{
|
||||
if (_serverEntries == NULL) {
|
||||
return;
|
||||
}
|
||||
qsort(_serverEntries, _numServerEntries, sizeof(server_entry), server_compare);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user