Module: sems
Branch: master
Commit: 08f6326ac20e4743a8758fae94b1b0bd3ea2ba09
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=08f6326ac20e4743a8758fae94b1b0bd3ea2ba09

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Fri Oct  1 12:35:02 2010 +0200

avoid to copy the string even if solaris defines getenv to need a char* 
argument.

---

 core/AmUtils.cpp |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/core/AmUtils.cpp b/core/AmUtils.cpp
index 9f31e41..d5842ac 100644
--- a/core/AmUtils.cpp
+++ b/core/AmUtils.cpp
@@ -1020,14 +1020,11 @@ void add_env_path(const char* name, const string& path)
 {
   string var(path);
   char*  old_path=0;
-  char name_s[50];
 
   regex_t path_reg;
 
-  strcpy(name_s, name);
-
   assert(name);
-  if((old_path = getenv(name_s)) != 0) {
+  if((old_path = getenv((char*)name)) != 0) {
     if(strlen(old_path)){
            
       if(regcomp(&path_reg,("[:|^]" + path + "[:|$]").c_str(),REG_NOSUB)){

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to