version 1.11, 2009/03/16 23:37:28 |
version 1.13, 2009/03/23 14:22:11 |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
|
#include "private.h" |
#include "libmdoc.h" |
|
|
|
#ifdef __linux__ |
|
extern size_t strlcpy(char *, const char *, size_t); |
|
extern size_t strlcat(char *, const char *, size_t); |
|
#endif |
|
|
/* |
/* |
* Contains wrappers for common functions to simplify their general |
* Contains wrappers for common functions to simplify their general |
* usage throughout this codebase. |
* usage throughout this codebase. |
Line 59 xrealloc(void *ptr, size_t sz) |
|
Line 64 xrealloc(void *ptr, size_t sz) |
|
return(p); |
return(p); |
} |
} |
|
|
void * |
|
xcalloc(size_t num, size_t sz) |
|
{ |
|
void *p; |
|
|
|
if (NULL == (p = calloc(num, sz))) |
|
err(EXIT_FAILURE, "calloc"); |
|
return(p); |
|
} |
|
|
|
char * |
char * |
xstrdup(const char *p) |
xstrdup(const char *p) |