mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-05 09:14:03 +00:00
If one's message is longer than the buffer size, then we reset 'cnt' at the
wrong point and the actual column # get out of sync across the buffer size.
This commit is contained in:
parent
fcc2fa496d
commit
b0023655af
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=223940
@ -239,8 +239,9 @@ makemsg(char *fname)
|
|||||||
err(1, "can't read %s", fname);
|
err(1, "can't read %s", fname);
|
||||||
setegid(egid);
|
setegid(egid);
|
||||||
}
|
}
|
||||||
|
cnt = 0;
|
||||||
while (fgets(lbuf, sizeof(lbuf), stdin)) {
|
while (fgets(lbuf, sizeof(lbuf), stdin)) {
|
||||||
for (cnt = 0, p = lbuf; (ch = *p) != '\0'; ++p, ++cnt) {
|
for (p = lbuf; (ch = *p) != '\0'; ++p, ++cnt) {
|
||||||
if (ch == '\r') {
|
if (ch == '\r') {
|
||||||
putc('\r', fp);
|
putc('\r', fp);
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user