Qkumba spotted a bug in decode_base64() - fixed!

This commit is contained in:
Bobbi Webber-Manners 2021-05-15 01:14:46 -04:00
parent 1eeed20f50
commit 29f4450eb6
2 changed files with 4 additions and 3 deletions

View File

@ -120,7 +120,7 @@ ATARI_CFG = atari.cfg
ld65 -o $*.prg -C c64.cfg -m $*.c64.map -vm $< $(IP65LIB) $(C64DRIVERLIB) c64.lib
%.bin: %.s.o $(BUILDS)
ld65 -o $*.bin -C apple2.cfg -m $*.a2.map -vm $< $(IP65LIB) $(A2DRIVERLIB) apple2.lib
ld65 -o $*.bin -C apple2enh-loader.cfg -m $*.a2.map -vm $< $(IP65LIB) $(A2DRIVERLIB) apple2.lib
%.com: %.s.o $(BUILDS)
ld65 -o $*.com -C $(ATARI_CFG) -m $*.atr.map -vm $< $(IP65LIB) $(ATRDRIVERLIB) atari.lib

View File

@ -20,7 +20,7 @@
#include "email_common.h"
// Program constants
#define MSGS_PER_PAGE 19 // Number of messages shown on summary screen
#define MSGS_PER_PAGE 18 //19 // Number of messages shown on summary screen
#define PROMPT_ROW 24 // Row that data entry prompt appears on
#define LINEBUFSZ 1000 // According to RFC2822 Section 2.1.1 (998+CRLF)
#define READSZ 512 // Size of buffer for copying files
@ -574,7 +574,7 @@ uint16_t decode_base64(char *p) {
p[j++] = b[p[i]] << 2 | b[p[i + 1]] >> 4;
if (p[i + 2] != '=')
p[j++] = b[p[i + 1]] << 4 | b[p[i + 2]] >> 2;
if (linebuf[i + 3] != '=')
if (p[i + 3] != '=')
p[j++] = b[p[i + 2]] << 6 | b[p[i + 3]];
i += 4;
}
@ -2465,6 +2465,7 @@ void main(void) {
error(ERR_FATAL, "Need 128K");
videomode(VIDEOMODE_80COL);
// printf("heapmemavail=%d heapmaxavail=%d\n", _heapmemavail(), _heapmaxavail());
readconfigfile();
load_prefs();
read_email_db(first_msg, 1, 0);