contrib/gdb-7/gdb/utils.c
char *
savestring (const char *ptr, size_t size)
{
  char *p = (char *) xmalloc (size + 1);

  memcpy (p, ptr, size);
  p[size] = 0;
  return p;
}
/* Make a copy of the string at PTR with SIZE characters
   (and add a null character at the end in the copy).
   Uses malloc to get the space.  Returns the address of the copy.  */
Make a copy of the string at PTR with SIZE characters
(and add a null character at the end in the copy).
Uses malloc to get the space.  Returns the address of the copy.
Make a copy of the string at PTR with SIZE characters ( and add a null character at the end in the copy ) . Uses malloc to get the space . Returns the address of the copy .
char *
savestring (const char *ptr, size_t size)
{
  char *p = (char *) xmalloc (size + 1);
  memcpy (p, ptr, size);
  p[size] = 0;
  return p;
}
char * savestring ( const char * ptr , size_t size ) { char * p = ( char * ) xmalloc ( size + 1 ) ; memcpy ( p , ptr , size ) ; p [ size ] = 0 ; return p ; }
Make a copy of the string at PTR with SIZE characters
(and add a null character at the end in the copy).
Make a copy of the string at PTR with SIZE characters ( and add a null character at the end in the copy ) .