projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move hash.[hc] into lib-lib/
[apps/madmutt.git]
/
pgppacket.c
diff --git
a/pgppacket.c
b/pgppacket.c
index
206f13c
..
add9945
100644
(file)
--- a/
pgppacket.c
+++ b/
pgppacket.c
@@
-17,13
+17,13
@@
#include <unistd.h>
#include <time.h>
#include <unistd.h>
#include <time.h>
+#include <lib-lib/mem.h>
+
#include "sha1.h"
#include "lib.h"
#include "pgplib.h"
#include "pgppacket.h"
#include "sha1.h"
#include "lib.h"
#include "pgplib.h"
#include "pgppacket.h"
-#include "lib/mem.h"
-
#define CHUNKSIZE 1024
static unsigned char *pbuf = NULL;
#define CHUNKSIZE 1024
static unsigned char *pbuf = NULL;
@@
-57,16
+57,15
@@
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;
unsigned char *pgp_read_packet (FILE * fp, size_t * len)
{
size_t used = 0;
-
long
startpos;
+
off_t
startpos;
unsigned char ctb;
unsigned char b;
size_t material;
unsigned char ctb;
unsigned char b;
size_t material;
- startpos = ftell (fp);
+ startpos = ftell
o
(fp);
if (!plen) {
if (!plen) {
- plen = CHUNKSIZE;
- pbuf = mem_malloc (plen);
+ pbuf = p_new(char, plen = CHUNKSIZE);
}
if (fread (&ctb, 1, 1, fp) < 1) {
}
if (fread (&ctb, 1, 1, fp) < 1) {
@@
-193,12
+192,12
@@
unsigned char *pgp_read_packet (FILE * fp, size_t * len)
bail:
bail:
- fseek (fp, startpos, SEEK_SET);
+ fseek
o
(fp, startpos, SEEK_SET);
return NULL;
}
void pgp_release_packet (void)
{
plen = 0;
return NULL;
}
void pgp_release_packet (void)
{
plen = 0;
-
mem_free
(&pbuf);
+
p_delete
(&pbuf);
}
}