* please see the file GPL in the top level source directory.
*/
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <time.h>
-
-#include <lib-lib/mem.h>
+#include <lib-lib/lib-lib.h>
#include <lib-hash/hash.h>
#include "lib.h"
static int read_material (size_t material, size_t * used, FILE * fp)
{
if (*used + material >= plen) {
- unsigned char *p;
- size_t nplen;
-
- nplen = *used + material + CHUNKSIZE;
-
- if (!(p = realloc (pbuf, nplen))) { /* __MEM_CHECKED__ */
- perror ("realloc");
- return -1;
- }
- plen = nplen;
- pbuf = p;
+ p_realloc(&pbuf, plen = *used + material + CHUNKSIZE);
}
if (fread (pbuf + *used, 1, material, fp) < material) {