diff src/mkoctfile.in.cc @ 26370:190702f4a075 stable

mkoctfile.in.cc: Fix static analyzer detected issues (bug #55347). * mkoctfile.in.cc (do_getenv): Delete function. * mkoctfile.in.cc (get_temp_directory): Replace calls to do_getenv with calls to octave_getenv from shared-fcns.h.
author Rik <rik@octave.org>
date Wed, 02 Jan 2019 10:34:39 -0800
parents 16607f64eea1
children 00f796120a6d
line wrap: on
line diff
--- a/src/mkoctfile.in.cc	Wed Jan 02 18:56:56 2019 +0100
+++ b/src/mkoctfile.in.cc	Wed Jan 02 10:34:39 2019 -0800
@@ -554,24 +554,16 @@
 }
 
 static std::string
-do_getenv (const std::string& name)
-{
-  char *value = ::getenv (name.c_str ());
-
-  return value ? value : "";
-}
-
-static std::string
 get_temp_directory (void)
 {
   std::string tempd;
 
 #if defined (__MINGW32__) || defined (_MSC_VER)
 
-  tempd = do_getenv ("TEMP");
+  tempd = octave_getenv ("TEMP");
 
   if (tempd.empty ())
-    tempd = do_getenv ("TMP");
+    tempd = octave_getenv ("TMP");
 
 #if defined (P_tmpdir)
   if (tempd.empty ())
@@ -585,7 +577,7 @@
 
 #else
 
-  tempd = do_getenv ("TMP");
+  tempd = octave_getenv ("TMP");
 
 #if defined (P_tmpdir)
   if (tempd.empty ())