(file) Return to ServerProcessUnix.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Service

Diff for /pegasus/src/Service/ServerProcessUnix.cpp between version 1.5 and 1.6

version 1.5, 2005/09/29 20:20:59 version 1.6, 2005/11/30 20:56:58
Line 192 
Line 192 
     }     }
  
     // allocate memory for the result     // allocate memory for the result
     char * process_name;      AutoArrayPtr<char> process_name(new char[close_paren - open_paren]);
     process_name = (char*) malloc(close_paren - open_paren - 1);  
  
     // copy the process name into the result     // copy the process name into the result
     strncpy (process_name, open_paren + 1, close_paren - open_paren -1);      strncpy (process_name.get(), open_paren + 1, close_paren - open_paren -1);
  
     // strncpy doesn't NULL-terminate the result, so do it here     // strncpy doesn't NULL-terminate the result, so do it here
     process_name[close_paren - open_paren -1] = '\0';      process_name.get()[close_paren - open_paren -1] = '\0';
  
     if (strcmp(process_name, server_process_name) != 0)      if (strcmp(process_name.get(), server_process_name) != 0)
     {     {
         return -1;         return -1;
     }     }


Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2