32 lines
560 B
C
32 lines
560 B
C
|
/*
|
|||
|
* xmem
|
|||
|
* architecture clients/serveur guinness : gestion m<EFBFBD>moire
|
|||
|
* Thomas Nemeth -- le 24 ao<EFBFBD>t 2001
|
|||
|
*
|
|||
|
*/
|
|||
|
|
|||
|
#include <stdio.h>
|
|||
|
#include <stdlib.h>
|
|||
|
#include <string.h>
|
|||
|
#include <strings.h>
|
|||
|
#include "xmem.h"
|
|||
|
|
|||
|
|
|||
|
void *xmalloc (size_t taille) {
|
|||
|
void *ret = malloc (taille);
|
|||
|
if (ret == NULL) {
|
|||
|
perror ("malloc() ");
|
|||
|
exit (-1);
|
|||
|
} else
|
|||
|
return ret;
|
|||
|
}
|
|||
|
|
|||
|
char *xstrdup (const char *chaine) {
|
|||
|
char *ret = strdup (chaine);
|
|||
|
if (ret == NULL) {
|
|||
|
perror ("strdup() ");
|
|||
|
exit (-1);
|
|||
|
} else
|
|||
|
return ret;
|
|||
|
}
|