diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-08-22 08:56:53 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-08-22 08:56:53 +0000 |
| commit | 82e197072bfe5d1641a505874618a52408c2280b (patch) | |
| tree | 088d0dde825b2200e3120e20dced36468c2294f5 | |
| parent | ci: sr.ht: run a codespell task at the end (diff) | |
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.
| -rw-r--r-- | config.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; } |
