summaryrefslogtreecommitdiffstats
path: root/mbbsd/stuff.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-10-10 09:11:52 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-10-10 09:11:52 +0800
commitff79e173c71cc5d3df73580d24293c9da2a5151f (patch)
tree5d274a6c5c5d09262d3358bcc46e0025f95ca7d2 /mbbsd/stuff.c
parent24bd2752cd23ce5ff7d7c0612a4b6e66642694e2 (diff)
downloadpttbbs-ff79e173c71cc5d3df73580d24293c9da2a5151f.tar
pttbbs-ff79e173c71cc5d3df73580d24293c9da2a5151f.tar.gz
pttbbs-ff79e173c71cc5d3df73580d24293c9da2a5151f.tar.bz2
pttbbs-ff79e173c71cc5d3df73580d24293c9da2a5151f.tar.lz
pttbbs-ff79e173c71cc5d3df73580d24293c9da2a5151f.tar.xz
pttbbs-ff79e173c71cc5d3df73580d24293c9da2a5151f.tar.zst
pttbbs-ff79e173c71cc5d3df73580d24293c9da2a5151f.zip
revise to proper buffer len
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2240 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/stuff.c')
-rw-r--r--mbbsd/stuff.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c
index 4002f39e..8f6f65d5 100644
--- a/mbbsd/stuff.c
+++ b/mbbsd/stuff.c
@@ -152,6 +152,17 @@ trim(char *buf)
}
}
+/* remove last '\n' */
+void chomp(char *src)
+{
+ while(*src){
+ if (*src == '\n')
+ *src = 0;
+ else
+ src++;
+ }
+}
+
/* ----------------------------------------------------- */
/* 字串檢查函數:英文、數字、檔名、E-mail address */
/* ----------------------------------------------------- */