This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Silence compiler warning
authorKarl Williamson <khw@cpan.org>
Wed, 14 Dec 2016 16:38:29 +0000 (09:38 -0700)
committerKarl Williamson <khw@cpan.org>
Wed, 14 Dec 2016 17:37:59 +0000 (10:37 -0700)
The FREEBSD compiler isn't smart enough to realize this isn't used
before setting.

locale.c

index a871b9e..07f599c 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -2540,9 +2540,9 @@ Perl_my_strerror(pTHX_ const int errnum)
     dVAR;
 
 #  ifdef USE_THREAD_SAFE_LOCALE
-    locale_t save_locale;
+    locale_t save_locale = NULL;
 #  else
-    char * save_locale;
+    char * save_locale = NULL;
     bool locale_is_C = FALSE;
 
     /* We have a critical section to prevent another thread from changing the