From c39d3320ab681401a3644401928e8be40f13afd9 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 2 Apr 2017 14:02:10 +0000 Subject: [PATCH] sh: Remove global state from collate_range_cmp(). The global state is not used across invocations of collate_range_cmp(). --- bin/sh/expand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/sh/expand.c b/bin/sh/expand.c index 3b6a45d08818..af88771babe1 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -145,10 +145,12 @@ appendarglist(struct arglist *list, char *str) static int collate_range_cmp(wchar_t c1, wchar_t c2) { - static wchar_t s1[2], s2[2]; + wchar_t s1[2], s2[2]; s1[0] = c1; + s1[1] = L'\0'; s2[0] = c2; + s2[1] = L'\0'; return (wcscoll(s1, s2)); }