From a027566295f7ddc6f93ae73bf64790008b77fc2f Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Sun, 21 Sep 2014 20:47:03 -0700 Subject: [PATCH] No need for mbstate_t to be static --- builtin.cpp | 3 +-- input_common.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/builtin.cpp b/builtin.cpp index e7c492859..1927b5cab 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -2605,8 +2605,7 @@ static int builtin_read(parser_t &parser, wchar_t **argv) int finished=0; wchar_t res=0; - static mbstate_t state; - memset(&state, '\0', sizeof(state)); + mbstate_t state = {}; while (!finished) { diff --git a/input_common.cpp b/input_common.cpp index 513fd8e36..045cb8f3f 100644 --- a/input_common.cpp +++ b/input_common.cpp @@ -243,7 +243,7 @@ wchar_t input_common_readch(int timed) } wchar_t res; - static mbstate_t state; + mbstate_t state = {}; while (1) {