if_diff/src/idfSymbol.cxx
//============================================================================
// Allocate a null-terminated string that duplicates the character
// array starting at the given location and having the given length.
//============================================================================
Allocate a null-terminated string that duplicates the character
array starting at the given location and having the given length.
Allocate a null - terminated string that duplicates the character array starting at the given location and having the given length .
static char *char_array_dup(const char *p, int len)
{
  if (p == NULL || len < 0) {
    return NULL;
  }
  char *d = new char[len + 1];
  if (d != NULL) {
    strncpy(d, p, len);
    d[len] = '\0';
  }
  return d;
}
static char * char_array_dup ( const char * p , int len ) { if ( p == NULL || len < 0 ) { return NULL ; } char * d = new char [ len + 1 ] ; if ( d != NULL ) { strncpy ( d , p , len ) ; d [ len ] = ' \0 ' ; } return d ; }
Allocate a null-terminated string that duplicates the character
array starting at the given location and having the given length.
Allocate a null - terminated string that duplicates the character array starting at the given location and having the given length .