Makes the logic that bit easier when you don't have to convert to EOF
mentally. No functional change intended.
enter_getfld (gstate, iob);
s = *gstate;
enter_getfld (gstate, iob);
s = *gstate;
- if ((c = Getc(s)) < 0) {
+ if ((c = Getc(s)) == EOF) {
*bufsz = *buf = 0;
leave_getfld (s);
return s->state = FILEEOF;
}
if (eom (c, s)) {
/* flush null messages */
*bufsz = *buf = 0;
leave_getfld (s);
return s->state = FILEEOF;
}
if (eom (c, s)) {
/* flush null messages */
- while ((c = Getc(s)) >= 0 && eom (c, s))
+ while ((c = Getc(s)) != EOF && eom (c, s))
Ungetc(c, s);
*bufsz = *buf = 0;
leave_getfld (s);
Ungetc(c, s);
*bufsz = *buf = 0;
leave_getfld (s);
case FLD:
if (c == '\n' || c == '-') {
/* we hit the header/body separator */
case FLD:
if (c == '\n' || c == '-') {
/* we hit the header/body separator */
- while (c != '\n' && (c = Getc(s)) >= 0) continue;
+ while (c != '\n' && (c = Getc(s)) != EOF)
+ ;
- if (c < 0 || (c = Getc(s)) < 0 || eom (c, s)) {
+ if (c == EOF || (c = Getc(s)) == EOF || eom (c, s)) {
/* flush null messages */
/* flush null messages */
- while ((c = Getc(s)) >= 0 && eom (c, s))
+ while ((c = Getc(s)) != EOF && eom (c, s))
Ungetc(c, s);
*bufsz = *buf = 0;
leave_getfld (s);
Ungetc(c, s);
*bufsz = *buf = 0;
leave_getfld (s);
if (i == sizeof from-1 && strncmp (text, "From ", sizeof from-1) == 0) {
s->msg_style = MS_MBOX;
delimstr = "\nFrom ";
if (i == sizeof from-1 && strncmp (text, "From ", sizeof from-1) == 0) {
s->msg_style = MS_MBOX;
delimstr = "\nFrom ";
- while ((c = Getc (s)) != '\n' && c >= 0) continue;
+ while ((c = Getc(s)) != EOF && c != '\n')
+ ;
} else {
/* not a Unix style maildrop */
s->readpos -= s->bytes_read;
} else {
/* not a Unix style maildrop */
s->readpos -= s->bytes_read;
if (s->msg_style == MS_MMDF) {
/* flush extra msg hdrs */
if (s->msg_style == MS_MMDF) {
/* flush extra msg hdrs */
- while ((c = Getc(s)) >= 0 && eom (c, s))
+ while ((c = Getc(s)) != EOF && eom (c, s))
if (s->msg_style == MS_MBOX) {
int c;
if (s->msg_style == MS_MBOX) {
int c;
- while ((c = Getc (s)) != '\n')
- if (c < 0)
- break;
+ while ((c = Getc(s)) != EOF && c != '\n')
+ ;