X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pgpmicalg.c;h=e63c9432e7818dbbaf1511ec629945dd2ffe4370;hp=6d2df9e7af551bf47ce0ddb92896bd4d80a71575;hb=ae0ce4dfcafa0c3820f107c5bfa8bd06e5272b57;hpb=96d53ff49c308769efbf708e1e65819077cb7af6 diff --git a/pgpmicalg.c b/pgpmicalg.c index 6d2df9e..e63c943 100644 --- a/pgpmicalg.c +++ b/pgpmicalg.c @@ -16,6 +16,7 @@ #endif #include "mutt.h" +#include "handler.h" #include "pgp.h" #include "pgppacket.h" #include "mime.h" @@ -26,6 +27,7 @@ #include #include +#include #include "lib/debug.h" static struct { @@ -58,13 +60,13 @@ static const char *pgp_hash_to_micalg (short id) static void pgp_dearmor (FILE * in, FILE * out) { char line[HUGE_STRING]; - long start; - long end; + off_t start; + off_t end; char *r; STATE state; - memset (&state, 0, sizeof (STATE)); + p_clear(&state, 1); state.fpin = in; state.fpout = out; @@ -92,7 +94,7 @@ static void pgp_dearmor (FILE * in, FILE * out) } /* actual data starts here */ - start = ftell (in); + start = ftello (in); /* find the checksum */ @@ -105,12 +107,12 @@ static void pgp_dearmor (FILE * in, FILE * out) return; } - if ((end = ftell (in) - mutt_strlen (line)) < start) { + if ((end = ftello (in) - m_strlen(line)) < start) { debug_print (1, ("end < start???\n")); return; } - if (fseek (in, start, SEEK_SET) == -1) { + if (fseeko (in, start, SEEK_SET) == -1) { debug_print (1, ("Can't seekto start.\n")); return; }