summaryrefslogtreecommitdiff
path: root/sfeed_plain.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2017-06-29 19:04:21 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2017-06-29 19:04:21 +0200
commite2719867bc14ed7d9a91d160e33d1071925407a5 (patch)
tree0b5d8f18fafbac721ec585a45313cae44e954868 /sfeed_plain.c
parentcfd9f1f73aaadd5a6eeac7b542419a25a98a8e99 (diff)
sfeed_plain: use setlocale() for glibc
this is required for mbtowc for glibc (not required in musl or on OpenBSD).
Diffstat (limited to 'sfeed_plain.c')
-rw-r--r--sfeed_plain.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sfeed_plain.c b/sfeed_plain.c
index ee836b5..b88a776 100644
--- a/sfeed_plain.c
+++ b/sfeed_plain.c
@@ -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");