mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-15 22:05:24 -05:00
config: don't pass -1 to mbstowcs(), silences linker(?) warning
'n' _is_ ignored when 'dest' is NULL, but you can still get the
following warning:
In function ‘mbstowcs’,
inlined from ‘parse_section_scrollback’ at ../config.c:429:26:
/usr/include/bits/stdlib.h:129:10: warning: ‘__mbstowcs_alias’ specified size 18446744073709551612 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
129 | return __mbstowcs_alias (__dst, __src, __len);
To silence this warning, pass 0 instead, since it is ignored anyway.
This commit is contained in:
parent
11cb08f1b5
commit
82e197072b
1 changed files with 4 additions and 2 deletions
6
config.c
6
config.c
|
|
@ -426,9 +426,11 @@ parse_section_scrollback(const char *key, const char *value, struct config *conf
|
|||
free(conf->scrollback.indicator.text);
|
||||
conf->scrollback.indicator.text = NULL;
|
||||
|
||||
size_t len = mbstowcs(NULL, value, -1);
|
||||
size_t len = mbstowcs(NULL, value, 0);
|
||||
if (len < 0) {
|
||||
LOG_AND_NOTIFY_ERRNO("%s:%d: [scrollback]: indicator-format: invalid value: %s", path, lineno, value);
|
||||
LOG_AND_NOTIFY_ERRNO(
|
||||
"%s:%d: [scrollback]: indicator-format: "
|
||||
"invalid value: %s", path, lineno, value);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue