diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-11-01 11:35:33 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-11-01 11:35:33 -0400 |
commit | aab36a3e0665d201f0df52373c37e5af837361a7 (patch) | |
tree | 7a6b37af459c17c993a3b97e639df7df34ed3610 /split.c | |
parent | e67e58f6c2f94ee4294b4a922f14cb2dda0ff7bb (diff) |
Diffstat (limited to 'split.c')
-rw-r--r-- | split.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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) { |