Set errno in vaswprintf in case vswprintf does not

As is the case on GNU.
weechat-hashes
Curtis McEnroe 2018-08-20 17:28:42 -04:00
parent 133ff4e651
commit afae851319
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 1 additions and 0 deletions

1
pls.c
View File

@ -75,6 +75,7 @@ int vaswprintf(wchar_t **ret, const wchar_t *format, va_list ap) {
va_list _ap; va_list _ap;
va_copy(_ap, ap); va_copy(_ap, ap);
errno = EOVERFLOW; // vswprintf may not set errno.
int len = vswprintf(*ret, 1 + cap, format, _ap); int len = vswprintf(*ret, 1 + cap, format, _ap);
va_end(_ap); va_end(_ap);