sfeed_plain: use setlocale() for glibc

this is required for mbtowc for glibc (not required in musl or on OpenBSD).
This commit is contained in:
Hiltjo Posthuma 2017-06-29 19:04:21 +02:00
parent cfd9f1f73a
commit e2719867bc
1 changed files with 6 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include <ctype.h>
#include <err.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -53,6 +54,11 @@ main(int argc, char *argv[])
char *name;
int i;
if (pledge("stdio rpath", NULL) == -1)
err(1, "pledge");
setlocale(LC_CTYPE, "");
if (pledge(argc == 1 ? "stdio" : "stdio rpath", NULL) == -1)
err(1, "pledge");