diff --git a/src/peep/staff.c b/src/peep/staff.c index 8089a10eda..61a31ac64c 100644 --- a/src/peep/staff.c +++ b/src/peep/staff.c @@ -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) diff --git a/src/windows/server_list.c b/src/windows/server_list.c index 596bc3cc54..017d66a5ff 100644 --- a/src/windows/server_list.c +++ b/src/windows/server_list.c @@ -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); }