diff --git a/usr.bin/mail/collect.c b/usr.bin/mail/collect.c --- a/usr.bin/mail/collect.c +++ b/usr.bin/mail/collect.c @@ -152,7 +152,7 @@ } for (;;) { colljmp_p = 1; - c = readline(stdin, linebuf, LINESIZE); + c = readline(stdin, linebuf, sizeof(linebuf)); colljmp_p = 0; if (c < 0) { if (value("interactive") != NULL && @@ -163,7 +163,7 @@ break; } lastlong = longline; - longline = c == LINESIZE - 1; + longline = c == sizeof(linebuf) - 1; eofcount = 0; hadintr = 0; if (linebuf[0] == '.' && linebuf[1] == '\0' && @@ -384,11 +384,12 @@ (void)fflush(stdout); lc = 0; cc = 0; - while ((rc = readline(fbuf, linebuf, LINESIZE)) >= 0) { - if (rc != LINESIZE - 1) + while ((rc = readline(fbuf, linebuf, + sizeof(linebuf))) >= 0) { + if (rc != sizeof(linebuf) - 1) lc++; if ((t = putline(collf, linebuf, - rc != LINESIZE - 1)) < 0) { + rc != sizeof(linebuf) - 1)) < 0) { (void)Fclose(fbuf); goto err; } diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c --- a/usr.bin/mail/lex.c +++ b/usr.bin/mail/lex.c @@ -223,7 +223,8 @@ */ n = 0; for (;;) { - if (readline(input, &linebuf[n], LINESIZE - n) < 0) { + if (readline(input, &linebuf[n], + sizeof(linebuf) - n) < 0) { if (n == 0) n = -1; break; diff --git a/usr.bin/mail/util.c b/usr.bin/mail/util.c --- a/usr.bin/mail/util.c +++ b/usr.bin/mail/util.c @@ -135,7 +135,7 @@ ibuf = setinput(mp); if ((lc = mp->m_lines - 1) < 0) return (NULL); - if (readline(ibuf, linebuf, LINESIZE) < 0) + if (readline(ibuf, linebuf, sizeof(linebuf)) < 0) return (NULL); while (lc > 0) { if ((lc = gethfield(ibuf, linebuf, lc, &colon)) < 0) @@ -184,7 +184,7 @@ ungetc(c = getc(f), f); if (c != ' ' && c != '\t') break; - if ((c = readline(f, line2, LINESIZE)) < 0) + if ((c = readline(f, line2, sizeof(line2))) < 0) break; rem--; for (cp2 = line2; *cp2 == ' ' || *cp2 == '\t'; cp2++) @@ -503,7 +503,7 @@ return (cp); ibuf = setinput(mp); namebuf[0] = '\0'; - if (readline(ibuf, linebuf, LINESIZE) < 0) + if (readline(ibuf, linebuf, sizeof(linebuf)) < 0) return (savestr(namebuf)); newname: for (cp = linebuf; *cp != '\0' && *cp != ' '; cp++) @@ -512,10 +512,10 @@ ; for (cp2 = &namebuf[strlen(namebuf)]; *cp != '\0' && *cp != ' ' && *cp != '\t' && - cp2 < namebuf + LINESIZE - 1;) + cp2 < namebuf + sizeof(namebuf) - 1;) *cp2++ = *cp++; *cp2 = '\0'; - if (readline(ibuf, linebuf, LINESIZE) < 0) + if (readline(ibuf, linebuf, sizeof(linebuf)) < 0) return (savestr(namebuf)); if ((cp = strchr(linebuf, 'F')) == NULL) return (savestr(namebuf));