projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added -messageid switch to send(1) and post(8). This allows selection
[mmh]
/
uip
/
mhparse.c
diff --git
a/uip/mhparse.c
b/uip/mhparse.c
index
8035113
..
25bbad7
100644
(file)
--- a/
uip/mhparse.c
+++ b/
uip/mhparse.c
@@
-22,8
+22,6
@@
extern int debugsw;
extern int debugsw;
-extern int endian; /* mhmisc.c */
-
extern pid_t xpid; /* mhshowsbr.c */
/* cache policies */
extern pid_t xpid; /* mhshowsbr.c */
/* cache policies */
@@
-1728,8
+1726,8
@@
openBase64 (CT ct, char **file)
{
int bitno, cc, digested;
int fd, len, skip, own_ct_fp = 0;
{
int bitno, cc, digested;
int fd, len, skip, own_ct_fp = 0;
- unsigned long bits;
- unsigned char value, *b, *b1, *b2, *b3;
+ uint32_t bits;
+ unsigned char value, b;
unsigned char *cp, *ep;
char buffer[BUFSIZ];
/* sbeck -- handle suffixes */
unsigned char *cp, *ep;
char buffer[BUFSIZ];
/* sbeck -- handle suffixes */
@@
-1737,11
+1735,6
@@
openBase64 (CT ct, char **file)
CE ce;
MD5_CTX mdContext;
CE ce;
MD5_CTX mdContext;
- b = (unsigned char *) &bits;
- b1 = &b[endian > 0 ? 1 : 2];
- b2 = &b[endian > 0 ? 2 : 1];
- b3 = &b[endian > 0 ? 3 : 0];
-
ce = ct->c_cefile;
if (ce->ce_fp) {
fseek (ce->ce_fp, 0L, SEEK_SET);
ce = ct->c_cefile;
if (ce->ce_fp) {
fseek (ce->ce_fp, 0L, SEEK_SET);
@@
-1776,8
+1769,8
@@
openBase64 (CT ct, char **file)
}
if (cp != NULL && *cp != '\0') {
if (ce->ce_unlink) {
}
if (cp != NULL && *cp != '\0') {
if (ce->ce_unlink) {
- // Temporary file already exists, so we rename to
- // version with extension.
+ /* Temporary file already exists, so we rename to
+ version with extension. */
char *file_org = strdup(ce->ce_file);
ce->ce_file = add (cp, ce->ce_file);
if (rename(file_org, ce->ce_file)) {
char *file_org = strdup(ce->ce_file);
ce->ce_file = add (cp, ce->ce_file);
if (rename(file_org, ce->ce_file)) {
@@
-1850,17
+1843,20
@@
openBase64 (CT ct, char **file)
bits |= value << bitno;
test_end:
if ((bitno -= 6) < 0) {
bits |= value << bitno;
test_end:
if ((bitno -= 6) < 0) {
- putc ((char) *b1, ce->ce_fp);
+ b = (bits >> 16) & 0xff;
+ putc ((char) b, ce->ce_fp);
if (digested)
if (digested)
- MD5Update (&mdContext, b1, 1);
+ MD5Update (&mdContext, &b, 1);
if (skip < 2) {
if (skip < 2) {
- putc ((char) *b2, ce->ce_fp);
+ b = (bits >> 8) & 0xff;
+ putc ((char) b, ce->ce_fp);
if (digested)
if (digested)
- MD5Update (&mdContext, b2, 1);
+ MD5Update (&mdContext, &b, 1);
if (skip < 1) {
if (skip < 1) {
- putc ((char) *b3, ce->ce_fp);
+ b = bits & 0xff;
+ putc ((char) b, ce->ce_fp);
if (digested)
if (digested)
- MD5Update (&mdContext, b3, 1);
+ MD5Update (&mdContext, &b, 1);
}
}
}
}
@@
-2008,8
+2004,8
@@
openQuoted (CT ct, char **file)
}
if (cp != NULL && *cp != '\0') {
if (ce->ce_unlink) {
}
if (cp != NULL && *cp != '\0') {
if (ce->ce_unlink) {
- // Temporary file already exists, so we rename to
- // version with extension.
+ /* Temporary file already exists, so we rename to
+ version with extension. */
char *file_org = strdup(ce->ce_file);
ce->ce_file = add (cp, ce->ce_file);
if (rename(file_org, ce->ce_file)) {
char *file_org = strdup(ce->ce_file);
ce->ce_file = add (cp, ce->ce_file);
if (rename(file_org, ce->ce_file)) {
@@
-2232,8
+2228,8
@@
open7Bit (CT ct, char **file)
}
if (cp != NULL && *cp != '\0') {
if (ce->ce_unlink) {
}
if (cp != NULL && *cp != '\0') {
if (ce->ce_unlink) {
- // Temporary file already exists, so we rename to
- // version with extension.
+ /* Temporary file already exists, so we rename to
+ version with extension. */
char *file_org = strdup(ce->ce_file);
ce->ce_file = add (cp, ce->ce_file);
if (rename(file_org, ce->ce_file)) {
char *file_org = strdup(ce->ce_file);
ce->ce_file = add (cp, ce->ce_file);
if (rename(file_org, ce->ce_file)) {
@@
-2820,15
+2816,10
@@
static int
readDigest (CT ct, char *cp)
{
int bitno, skip;
readDigest (CT ct, char *cp)
{
int bitno, skip;
- unsigned long bits;
+ uint32_t bits;
char *bp = cp;
unsigned char *dp, value, *ep;
char *bp = cp;
unsigned char *dp, value, *ep;
- unsigned char *b, *b1, *b2, *b3;
- b = (unsigned char *) &bits,
- b1 = &b[endian > 0 ? 1 : 2],
- b2 = &b[endian > 0 ? 2 : 1],
- b3 = &b[endian > 0 ? 3 : 0];
bitno = 18;
bits = 0L;
skip = 0;
bitno = 18;
bits = 0L;
skip = 0;
@@
-2850,11
+2841,11
@@
test_end:
if ((bitno -= 6) < 0) {
if (dp + (3 - skip) > ep)
goto invalid_digest;
if ((bitno -= 6) < 0) {
if (dp + (3 - skip) > ep)
goto invalid_digest;
- *dp++ = *b1;
+ *dp++ = (bits >> 16) & 0xff;
if (skip < 2) {
if (skip < 2) {
- *dp++ = *b2;
+ *dp++ = (bits >> 8) & 0xff;
if (skip < 1)
if (skip < 1)
- *dp++ = *b3;
+ *dp++ = bits & 0xff;
}
bitno = 18;
bits = 0L;
}
bitno = 18;
bits = 0L;