summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-05-31 20:09:55 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-05-31 20:09:55 +0800
commit99872db43844acada2f32cef254f870f137c1c04 (patch)
tree22586318276134038f6ea801be1ef845e8c10592
parentbbbd9c229cc74615568984715cfa524b053384e0 (diff)
downloadpttbbs-99872db43844acada2f32cef254f870f137c1c04.tar
pttbbs-99872db43844acada2f32cef254f870f137c1c04.tar.gz
pttbbs-99872db43844acada2f32cef254f870f137c1c04.tar.bz2
pttbbs-99872db43844acada2f32cef254f870f137c1c04.tar.lz
pttbbs-99872db43844acada2f32cef254f870f137c1c04.tar.xz
pttbbs-99872db43844acada2f32cef254f870f137c1c04.tar.zst
pttbbs-99872db43844acada2f32cef254f870f137c1c04.zip
reduce one strlen()
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2740 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/chat.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mbbsd/chat.c b/mbbsd/chat.c
index 612611c7..f548775f 100644
--- a/mbbsd/chat.c
+++ b/mbbsd/chat.c
@@ -52,8 +52,7 @@ chat_send(int fd, const char *buf)
int len;
char genbuf[200];
- snprintf(genbuf, sizeof(genbuf), "%s\n", buf);
- len = strlen(genbuf);
+ len = snprintf(genbuf, sizeof(genbuf), "%s\n", buf);
return (send(fd, genbuf, len, 0) == len);
}