diff options
-rw-r--r-- | usr.bin/sort/bwstring.c | 6 | ||||
-rw-r--r-- | usr.bin/sort/sort.c | 10 |
2 files changed, 2 insertions, 14 deletions
diff --git a/usr.bin/sort/bwstring.c b/usr.bin/sort/bwstring.c index ca01896..497947c 100644 --- a/usr.bin/sort/bwstring.c +++ b/usr.bin/sort/bwstring.c @@ -910,7 +910,6 @@ bws_month_score(const struct bwstring *s0) if (MB_CUR_MAX == 1) { const unsigned char *end, *s; - size_t len; s = s0->data.cstr; end = s + s0->len; @@ -918,8 +917,6 @@ bws_month_score(const struct bwstring *s0) while (isblank(*s) && s < end) ++s; - len = strlen((const char*)s); - for (int i = 11; i >= 0; --i) { if (cmonths[i] && (s == (unsigned char*)strstr((const char*)s, (char*)(cmonths[i])))) @@ -928,7 +925,6 @@ bws_month_score(const struct bwstring *s0) } else { const wchar_t *end, *s; - size_t len; s = s0->data.wstr; end = s + s0->len; @@ -936,8 +932,6 @@ bws_month_score(const struct bwstring *s0) while (iswblank(*s) && s < end) ++s; - len = wcslen(s); - for (int i = 11; i >= 0; --i) { if (wmonths[i] && (s == wcsstr(s, wmonths[i]))) return (i); diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c index 027cdac..089fb5f 100644 --- a/usr.bin/sort/sort.c +++ b/usr.bin/sort/sort.c @@ -209,14 +209,10 @@ sort_modifier_empty(struct sort_mods *sm) static void usage(bool opt_err) { - struct option *o; FILE *out; - out = stdout; - o = &(long_options[0]); + out = opt_err ? stderr : stdout; - if (opt_err) - out = stderr; fprintf(out, getstr(12), getprogname()); if (opt_err) exit(2); @@ -271,8 +267,6 @@ set_hw_params(void) { long pages, psize; - pages = psize = 0; - #if defined(SORT_THREADS) ncpu = 1; #endif @@ -280,7 +274,7 @@ set_hw_params(void) pages = sysconf(_SC_PHYS_PAGES); if (pages < 1) { perror("sysconf pages"); - psize = 1; + pages = 1; } psize = sysconf(_SC_PAGESIZE); if (psize < 1) { |