diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-23 03:02:01 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-23 03:02:01 +0800 |
commit | 8b45fd166b943e17dabb3f5cdf972baeb58e0346 (patch) | |
tree | 7b2e5bf09b7c9fd812d0ae7cacdfa049c4dc1e07 /mbbsd/vice.c | |
parent | a1bd04d7decea39d51bbc06b50755976d4184c50 (diff) | |
download | pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar.gz pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar.bz2 pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar.lz pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar.xz pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar.zst pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.zip |
sprintf() -> snprintf()
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@435 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/vice.c')
-rw-r--r-- | mbbsd/vice.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mbbsd/vice.c b/mbbsd/vice.c index 35a5641f..acc653fa 100644 --- a/mbbsd/vice.c +++ b/mbbsd/vice.c @@ -1,4 +1,4 @@ -/* $Id: vice.c,v 1.5 2002/07/21 09:26:02 in2 Exp $ */ +/* $Id: vice.c,v 1.6 2002/07/22 19:02:01 in2 Exp $ */ #include "bbs.h" #define VICE_PLAY BBSHOME "/etc/vice/vice.play" @@ -54,7 +54,7 @@ ran_showfile(int y, int x, char *filename, int maxnum) char buf[512]; bzero(buf, sizeof(char) * 512); - sprintf(buf, "%s%d", filename, rand() % maxnum + 1); + snprintf(buf, sizeof(buf), "%s%d", filename, rand() % maxnum + 1); if (!(fs = fopen(buf, "r"))) { move(10, 10); prints("can't open file: %s", buf); @@ -74,7 +74,7 @@ ran_showmfile(char *filename, int maxnum) { char buf[256]; - sprintf(buf, "%s%d", filename, rand() % maxnum + 1); + snprintf(buf, sizeof(buf), "%s%d", filename, rand() % maxnum + 1); return more(buf, YEA); } |