[PATCH] Fix compilations warnings
[apps/madmutt.git] / pgppacket.c
index f43f516..39ebdf2 100644 (file)
 #include <unistd.h>
 #include <time.h>
 
-#include "sha1.h"
+#include <lib-lib/mem.h>
+#include <lib-hash/hash.h>
+
 #include "lib.h"
 #include "pgplib.h"
 #include "pgppacket.h"
 
-#include "lib/mem.h"
-
 #define CHUNKSIZE 1024
 
 static unsigned char *pbuf = NULL;
@@ -57,7 +57,7 @@ static int read_material (size_t material, size_t * used, FILE * fp)
 unsigned char *pgp_read_packet (FILE * fp, size_t * len)
 {
   size_t used = 0;
-  LOFF_T startpos;
+  off_t startpos;
   unsigned char ctb;
   unsigned char b;
   size_t material;
@@ -65,8 +65,7 @@ unsigned char *pgp_read_packet (FILE * fp, size_t * len)
   startpos = ftello (fp);
 
   if (!plen) {
-    plen = CHUNKSIZE;
-    pbuf = mem_malloc (plen);
+    pbuf = p_new(char, plen = CHUNKSIZE);
   }
 
   if (fread (&ctb, 1, 1, fp) < 1) {
@@ -200,5 +199,5 @@ bail:
 void pgp_release_packet (void)
 {
   plen = 0;
-  mem_free (&pbuf);
+  p_delete(&pbuf);
 }