summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-05-10 10:51:30 -0400
committerJakob Kaivo <jkk@ung.org>2019-05-10 10:51:30 -0400
commitdedba650e7a2ad7ccc1b8a0a11f012efc90ab6d4 (patch)
tree6639b1c3cc618ac786f28541a04aa5335a5e5f84
parent790097310085ddc7184d6d3185e4deb9e528e091 (diff)
remember to call setlocale()
-rw-r--r--wc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/wc.c b/wc.c
index 511bd82..c11a3f8 100644
--- a/wc.c
+++ b/wc.c
@@ -20,6 +20,7 @@
#define _XOPEN_SOURCE 700
#include <errno.h>
#include <inttypes.h>
+#include <locale.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
@@ -141,6 +142,8 @@ int main(int argc, char *argv[])
int ret = 0;
int flags = 0;
int total = 0;
+
+ setlocale(LC_ALL, "");
int c;
while ((c = getopt(argc, argv, "cmlw")) != -1) {