summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-08 03:10:10 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-08 03:10:10 +0800
commit3e95f5f57f0988c3a48a4d9f40f38b7d7ca05d1b (patch)
tree1b124a7294dbd9d50fa67abc4e166258d81a7a28 /mbbsd
parentf7cffdd936750c3a73b2001da034f3f78bfceca8 (diff)
downloadpttbbs-3e95f5f57f0988c3a48a4d9f40f38b7d7ca05d1b.tar
pttbbs-3e95f5f57f0988c3a48a4d9f40f38b7d7ca05d1b.tar.gz
pttbbs-3e95f5f57f0988c3a48a4d9f40f38b7d7ca05d1b.tar.bz2
pttbbs-3e95f5f57f0988c3a48a4d9f40f38b7d7ca05d1b.tar.lz
pttbbs-3e95f5f57f0988c3a48a4d9f40f38b7d7ca05d1b.tar.xz
pttbbs-3e95f5f57f0988c3a48a4d9f40f38b7d7ca05d1b.tar.zst
pttbbs-3e95f5f57f0988c3a48a4d9f40f38b7d7ca05d1b.zip
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@312 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/gamble.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c
index 065b05b4..69127e1e 100644
--- a/mbbsd/gamble.c
+++ b/mbbsd/gamble.c
@@ -1,4 +1,4 @@
-/* $Id: gamble.c,v 1.12 2002/06/07 19:03:25 ptt Exp $ */
+/* $Id: gamble.c,v 1.13 2002/06/07 19:10:10 ptt Exp $ */
#include "bbs.h"
#ifndef _BBS_UTIL_C_
@@ -49,8 +49,9 @@ int post_file(char* bname, char* title, char *filename, char* author)
if(size<=0) return -1;
if(!(fp=fopen(filename,"r")) ) return -1;
- msg= (char *)malloc(size);
- fread(msg,1,size,fp);
+ msg= (char *)malloc(size+1);
+ size = fread(msg,1,size,fp);
+ msg[size]=0;
size= post_msg(bname, title, msg, author);
fclose(fp);
free(msg);