diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-06-08 03:10:10 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-06-08 03:10:10 +0800 |
commit | 6bd8aa4474c4291eed6490ec8ba13b0d16a8fe01 (patch) | |
tree | 2544561f40c013c7685ee8e3c501f7b7ee0b4755 | |
parent | d3776f2bd3beeedaa25ce824bf1adf6598b0e2d9 (diff) | |
download | pttbbs-6bd8aa4474c4291eed6490ec8ba13b0d16a8fe01.tar pttbbs-6bd8aa4474c4291eed6490ec8ba13b0d16a8fe01.tar.gz pttbbs-6bd8aa4474c4291eed6490ec8ba13b0d16a8fe01.tar.bz2 pttbbs-6bd8aa4474c4291eed6490ec8ba13b0d16a8fe01.tar.lz pttbbs-6bd8aa4474c4291eed6490ec8ba13b0d16a8fe01.tar.xz pttbbs-6bd8aa4474c4291eed6490ec8ba13b0d16a8fe01.tar.zst pttbbs-6bd8aa4474c4291eed6490ec8ba13b0d16a8fe01.zip |
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@312 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/gamble.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pttbbs/mbbsd/gamble.c b/pttbbs/mbbsd/gamble.c index 065b05b4..69127e1e 100644 --- a/pttbbs/mbbsd/gamble.c +++ b/pttbbs/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); |