From 4eb27fc5a6fd92f91bf314d9f2e4b4da46dc8db1 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 11 Sep 2017 18:56:49 -0600 Subject: [PATCH 1/1] locale.c: Slight refactor This makes savepv() part of the expressions instead of a separate statement. --- locale.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/locale.c b/locale.c index 99d42e0..d31db26 100644 --- a/locale.c +++ b/locale.c @@ -3490,14 +3490,12 @@ Perl_my_strerror(pTHX_ const int errnum) /* This function is trivial if we have strerror_l() */ if (within_locale_scope) { - errstr = strerror(errnum); + errstr = savepv(strerror(errnum)); } else { - errstr = strerror_l(errnum, PL_C_locale_obj); + errstr = savepv(strerror_l(errnum, PL_C_locale_obj)); } - errstr = savepv(errstr); - # else /* Doesn't have strerror_l(). */ # ifdef USE_POSIX_2008_LOCALE -- 1.8.3.1