commit e2719867bc14ed7d9a91d160e33d1071925407a5
parent cfd9f1f73aaadd5a6eeac7b542419a25a98a8e99
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Thu, 29 Jun 2017 19:04:21 +0200
sfeed_plain: use setlocale() for glibc
this is required for mbtowc for glibc (not required in musl or on OpenBSD).
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git 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");