~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to libiberty/xmemdup.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-07-22 03:49:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040722034937-cysl08t1jvba4jrx
Tags: 1:3.3.9-3
USERINFO has been renamed to USERINFO.txt; adjust debian/rules code
to match, to get correct information on the About DDD dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
   This trivial function is in the public domain.
3
3
   Jeff Garzik, September 1999.  */
4
4
 
 
5
/*
 
6
 
 
7
@deftypefn Replacement void* xmemdup (void *@var{input}, size_t @var{copy_size}, size_t @var{alloc_size})
 
8
 
 
9
Duplicates a region of memory without fail.  First, @var{alloc_size} bytes
 
10
are allocated, then @var{copy_size} bytes from @var{input} are copied into
 
11
it, and the new memory is returned.  If fewer bytes are copied than were
 
12
allocated, the remaining memory is zeroed.
 
13
 
 
14
@end deftypefn
 
15
 
 
16
*/
 
17
 
5
18
#ifdef HAVE_CONFIG_H
6
19
#include "config.h"
7
20
#endif
9
22
#include "libiberty.h"
10
23
 
11
24
#include <sys/types.h> /* For size_t. */
 
25
#ifdef HAVE_STRING_H
 
26
#include <string.h>
 
27
#endif
12
28
 
13
29
PTR
14
30
xmemdup (input, copy_size, alloc_size)