Merge branch 'type-limit-fixes' into master

This commit is contained in:
Daniel Eklöf 2020-08-25 20:49:29 +02:00
commit 139f59c27d
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 5 additions and 3 deletions

View file

@ -427,7 +427,7 @@ parse_section_scrollback(const char *key, const char *value, struct config *conf
conf->scrollback.indicator.text = NULL;
size_t len = mbstowcs(NULL, value, 0);
if (len < 0) {
if (len == (size_t)-1) {
LOG_AND_NOTIFY_ERRNO(
"%s:%d: [scrollback]: indicator-format: "
"invalid value: %s", path, lineno, value);

6
shm.c
View file

@ -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);