From 8529829823bebf483ab22fe8d24c96394647a298 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Sat, 5 Nov 2011 10:31:30 +0100 Subject: [PATCH] Removed defines for obsolete BSD bcopy functions; Use getc() directly. --- h/nmh.h | 5 ----- sbr/m_getfld.c | 15 +++++++-------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/h/nmh.h b/h/nmh.h index 75d4d2a..26eb0a2 100644 --- a/h/nmh.h +++ b/h/nmh.h @@ -109,11 +109,6 @@ #include -#define bcmp(b1,b2,length) memcmp(b1, b2, length) -#define bcopy(b1,b2,length) memcpy(b2, b1, length) -#define bcpy(b1,b2,length) memcmp(b1, b2, length) -#define bzero(b,length) memset(b, 0, length) - #ifdef HAVE_KILLPG # define KILLPG(pgrp,sig) killpg(pgrp,sig); #else diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index 26707a2..586876a 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -42,7 +42,7 @@ ** This worked fine, until one day: a message with no body portion arrived. ** Then the ** -** while (eom(c = Getc(iob), iob)) +** while (eom(c = getc(iob), iob)) ** continue; ** ** loop caused m_getfld() to return FMTERR. So, that logic was changed to @@ -145,7 +145,6 @@ static int m_Eom(int, FILE *); static unsigned char *matchc(int, char *, int, char *); static unsigned char *locc(int, unsigned char *, unsigned char); -#define Getc(iob) getc(iob) #define eom(c,iob) (msg_style != MS_DEFAULT && \ (((c) == *msg_delim && m_Eom(c,iob)) ||\ (eom_action && (*eom_action)(c)))) @@ -213,7 +212,7 @@ m_getfld(int state, unsigned char *name, unsigned char *buf, register unsigned char *bp, *cp, *ep, *sp; register int cnt, c, i, j; - if ((c = Getc(iob)) < 0) { + if ((c = getc(iob)) < 0) { msg_count = 0; *buf = 0; return FILEEOF; @@ -221,7 +220,7 @@ m_getfld(int state, unsigned char *name, unsigned char *buf, if (eom(c, iob)) { if (! eom_action) { /* flush null messages */ - while ((c = Getc(iob)) >= 0 && eom(c, iob)) + while ((c = getc(iob)) >= 0 && eom(c, iob)) ; if (c >= 0) ungetc(c, iob); @@ -237,13 +236,13 @@ m_getfld(int state, unsigned char *name, unsigned char *buf, case FLD: if (c == '\n' || c == '-') { /* we hit the header/body separator */ - while (c != '\n' && (c = Getc(iob)) >= 0) + while (c != '\n' && (c = getc(iob)) >= 0) ; - if (c < 0 || (c = Getc(iob)) < 0 || eom(c, iob)) { + if (c < 0 || (c = getc(iob)) < 0 || eom(c, iob)) { if (! eom_action) { /* flush null messages */ - while ((c = Getc(iob)) >= 0 && eom(c, iob)) + while ((c = getc(iob)) >= 0 && eom(c, iob)) ; if (c >= 0) ungetc(c, iob); @@ -712,7 +711,7 @@ m_unknown(FILE *iob) if (msg_style == MS_MMDF) { /* flush extra msg hdrs */ - while ((c = Getc(iob)) >= 0 && eom(c, iob)) + while ((c = getc(iob)) >= 0 && eom(c, iob)) ; if (c >= 0) ungetc(c, iob); -- 1.7.10.4