summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-12-25 19:35:23 +0000
committerphk <phk@FreeBSD.org>1995-12-25 19:35:23 +0000
commit0ab20d23b0b629914697181cf3c906176ed75dbb (patch)
treeb39d5d2dab144c1f06ef4b0a7f074cab8070a581 /usr.sbin
parent24418113dbac55ff452d6380c22fa1fbe5f8cecb (diff)
downloadFreeBSD-src-0ab20d23b0b629914697181cf3c906176ed75dbb.zip
FreeBSD-src-0ab20d23b0b629914697181cf3c906176ed75dbb.tar.gz
Remove all trailing white space on the lines.
Suggested by: Phil Taylor <phil@zipmail.co.uk>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ctm/ctm_rmail/ctm_rmail.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/ctm/ctm_rmail/ctm_rmail.c b/usr.sbin/ctm/ctm_rmail/ctm_rmail.c
index a47f885..9b732fd 100644
--- a/usr.sbin/ctm/ctm_rmail/ctm_rmail.c
+++ b/usr.sbin/ctm/ctm_rmail/ctm_rmail.c
@@ -12,7 +12,8 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
+#include <strings.h>
+#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
@@ -273,6 +274,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.
*/
if (!decoding)
OpenPOWER on IntegriCloud