Use good m_ functions, because it smell like a flower, version 2.
[apps/madmutt.git] / lib-crypt / pgppacket.c
index 39ebdf2..2cfddbb 100644 (file)
@@ -7,17 +7,7 @@
  * 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"
@@ -37,7 +27,7 @@ static int read_material (size_t material, size_t * used, FILE * fp)
 
     nplen = *used + material + CHUNKSIZE;
 
-    if (!(p = realloc (pbuf, nplen))) { /* __MEM_CHECKED__ */
+    if (!(p = realloc(pbuf, nplen))) {
       perror ("realloc");
       return -1;
     }
@@ -65,7 +55,7 @@ unsigned char *pgp_read_packet (FILE * fp, size_t * len)
   startpos = ftello (fp);
 
   if (!plen) {
-    pbuf = p_new(char, plen = CHUNKSIZE);
+    pbuf = p_new(unsigned char, plen = CHUNKSIZE);
   }
 
   if (fread (&ctb, 1, 1, fp) < 1) {