diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-10-10 09:11:52 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-10-10 09:11:52 +0800 |
commit | ff79e173c71cc5d3df73580d24293c9da2a5151f (patch) | |
tree | 5d274a6c5c5d09262d3358bcc46e0025f95ca7d2 /mbbsd/stuff.c | |
parent | 24bd2752cd23ce5ff7d7c0612a4b6e66642694e2 (diff) | |
download | pttbbs-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.c | 11 |
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 */ /* ----------------------------------------------------- */ |