diff --git a/usr.sbin/ctm/ctm_rmail/ctm_rmail.c b/usr.sbin/ctm/ctm_rmail/ctm_rmail.c index a47f8853d015..9b732fdf939e 100644 --- a/usr.sbin/ctm/ctm_rmail/ctm_rmail.c +++ b/usr.sbin/ctm/ctm_rmail/ctm_rmail.c @@ -12,7 +12,8 @@ #include #include -#include +#include +#include #include #include #include @@ -272,6 +273,13 @@ read_piece(char *input_file) { line_no++; + /* + * Remove all trailing white space. + */ + i = strlen(line) - 1; + while (i > 0 && isspace(line[i])) + line[--i] = '\0'; + /* * Look for the beginning of an encoded piece. */