mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-09 05:33:58 -04:00
fix some buggy comparisons relating to signed/unsigned types
This commit is contained in:
parent
777a2eac51
commit
f3acfea815
2 changed files with 5 additions and 3 deletions
6
shm.c
6
shm.c
|
|
@ -131,10 +131,12 @@ page_size(void)
|
|||
{
|
||||
static size_t size = 0;
|
||||
if (size == 0) {
|
||||
size = sysconf(_SC_PAGE_SIZE);
|
||||
if (size < 0) {
|
||||
long n = sysconf(_SC_PAGE_SIZE);
|
||||
if (n <= 0) {
|
||||
LOG_ERRNO("failed to get page size");
|
||||
size = 4096;
|
||||
} else {
|
||||
size = (size_t)n;
|
||||
}
|
||||
}
|
||||
assert(size > 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue