Skip to content

Commit

Permalink
Avoid calling bcopy with a negative number of bytes to copy. This mig…
Browse files Browse the repository at this point in the history
…ht not be correct but this seems to have made bug #5 go away.
  • Loading branch information
acli authored and LegalizeAdulthood committed Apr 17, 2023
1 parent 4670203 commit 2411f51
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1255,8 +1255,10 @@ char* f;
fudge = do_indent((char*)NULL);
while (*cp == ' ' || *cp == '\t') cp++;
if ((fudge -= cp - line_start) != 0) {
if (fudge < 0)
bcopy(cp, cp + fudge, t - cp);
if (fudge < 0) {
if (t - cp > 0)
bcopy(cp, cp + fudge, t - cp);
}
else
for (s = t; s-- != cp; ) s[fudge] = *s;
(void) do_indent(line_start);
Expand Down

0 comments on commit 2411f51

Please sign in to comment.