This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix false nesting.
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 29 May 2014 14:13:08 +0000 (10:13 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 29 May 2014 14:15:05 +0000 (10:15 -0400)
[perl #121744]

Fix for Coverity perl5 CID 29014:
Nesting level does not match indentation (NESTING_INDENT_MISMATCH)

(Reindentation of the whole "if (!PL_use_safe_putenv)" block will follow.)

util.c

diff --git a/util.c b/util.c
index 39b24f0..8d2e135 100644 (file)
--- a/util.c
+++ b/util.c
@@ -2034,12 +2034,12 @@ Perl_my_setenv(pTHX_ const char *nam, const char *val)
     }
     else
        safesysfree(environ[i]);
     }
     else
        safesysfree(environ[i]);
-       nlen = strlen(nam);
-       vlen = strlen(val);
+    nlen = strlen(nam);
+    vlen = strlen(val);
 
 
-       environ[i] = (char*)safesysmalloc((nlen+vlen+2) * sizeof(char));
-       /* all that work just for this */
-       my_setenv_format(environ[i], nam, nlen, val, vlen);
+    environ[i] = (char*)safesysmalloc((nlen+vlen+2) * sizeof(char));
+    /* all that work just for this */
+    my_setenv_format(environ[i], nam, nlen, val, vlen);
     } else {
 # endif
 #   if defined(__CYGWIN__)|| defined(__SYMBIAN32__) || defined(__riscos__)
     } else {
 # endif
 #   if defined(__CYGWIN__)|| defined(__SYMBIAN32__) || defined(__riscos__)