summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-11-01 11:35:33 -0400
committerJakob Kaivo <jkk@ung.org>2019-11-01 11:35:33 -0400
commitaab36a3e0665d201f0df52373c37e5af837361a7 (patch)
tree7a6b37af459c17c993a3b97e639df7df34ed3610
parente67e58f6c2f94ee4294b4a922f14cb2dda0ff7bb (diff)
-rw-r--r--split.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/split.c b/split.c
index 7216f62..740381a 100644
--- a/split.c
+++ b/split.c
@@ -24,6 +24,7 @@
#define _POSIX_C_SOURCE 200809L
#include <inttypes.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -59,8 +60,7 @@ static char *nextsuffix(size_t n, char s[])
return s;
}
-static int
-split(const char *in, const char *base, size_t suffixlen, uintmax_t lines, uintmax_t bytes)
+static int split(const char *in, const char *base, size_t suffixlen, uintmax_t lines, uintmax_t bytes)
{
char oname[FILENAME_MAX] = {0};
char suffix[suffixlen + 2];
@@ -115,13 +115,15 @@ split(const char *in, const char *base, size_t suffixlen, uintmax_t lines, uintm
return 0;
}
-int main(int argc, char **argv)
+int main(int argc, char *argv[])
{
uintmax_t lines = 0;
uintmax_t bytes = 0;
size_t suffix = DEFAULT_SUFFIX_LENGTH;
char *end;
+ setlocale(LC_ALL, "");
+
int c;
while ((c = getopt(argc, argv, "l:a:b:")) != -1) {
switch (c) {