tools/dwarfDbg/dwarfDbgEsb.c
/*  Get a copy of the internal data buffer.
  It is up to the code calling this
  to free() the string using the
  pointer returned here. */
Get a copy of the internal data buffer.
It is up to the code calling this
to free() the string using the
pointer returned here.
Get a copy of the internal data buffer . It is up to the code calling this to free () the string using the pointer returned here .
static char* esbGetCopy(dwarfDbgPtr_t self, dwarfDbgEsb_t *data) {
  char* copy = NULL;
  size_t len = self->dwarfDbgEsb->esbStringLen(self, data);
  if (len) {
    copy = (char*)malloc(len + 1);
    strcpy(copy,self->dwarfDbgEsb->esbGetString(self, data));
  }
  return copy;
}
static char * esbGetCopy ( dwarfDbgPtr_t self , dwarfDbgEsb_t * data ) { char * copy = NULL ; size_t len = self -> dwarfDbgEsb -> esbStringLen ( self , data ) ; if ( len ) { copy = ( char * ) malloc ( len + 1 ) ; strcpy ( copy , self -> dwarfDbgEsb -> esbGetString ( self , data ) ) ; } return copy ; }
Get a copy of the internal data buffer.
Get a copy of the internal data buffer .