summaryrefslogtreecommitdiffstats
path: root/mbbsd/more.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-23 03:02:01 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-23 03:02:01 +0800
commit8b45fd166b943e17dabb3f5cdf972baeb58e0346 (patch)
tree7b2e5bf09b7c9fd812d0ae7cacdfa049c4dc1e07 /mbbsd/more.c
parenta1bd04d7decea39d51bbc06b50755976d4184c50 (diff)
downloadpttbbs-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/more.c')
-rw-r--r--mbbsd/more.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/mbbsd/more.c b/mbbsd/more.c
index 33c6e1b3..2acf144d 100644
--- a/mbbsd/more.c
+++ b/mbbsd/more.c
@@ -1,4 +1,4 @@
-/* $Id: more.c,v 1.17 2002/07/21 09:26:02 in2 Exp $ */
+/* $Id: more.c,v 1.18 2002/07/22 19:02:00 in2 Exp $ */
#include "bbs.h"
#define MORE_BUFSIZE 4096
#define MORE_WINSIZE 4096
@@ -246,12 +246,14 @@ more(char *fpath, int promptend)
strncpy(SearchStr, pos, strlen(search_str));
SearchStr[strlen(search_str)] = 0;
searching = 0;
- sprintf(msg, "%.*s\033[7m%s\033[m", pos - buf, buf,
- SearchStr);
+ snprintf(msg, sizeof(msg),
+ "%.*s\033[7m%s\033[m", pos - buf, buf,
+ SearchStr);
while ((pos = fptr(pos1 = pos + strlen(search_str),
search_str))) {
- sprintf(buf1, "%.*s\033[7m%s\033[m", pos - pos1,
- pos1, SearchStr);
+ snprintf(buf1, sizeof(buf1),
+ "%.*s\033[7m%s\033[m", pos - pos1,
+ pos1, SearchStr);
strcat(msg, buf1);
}
strcat(msg, pos1);
@@ -497,7 +499,8 @@ more(char *fpath, int promptend)
char tmpbuf[128];
setuserfile(tmpbuf, ask_tmpbuf(b_lines - 1));
- sprintf(buf, "cp -f %s %s", fpath, tmpbuf);
+ snprintf(buf, sizeof(buf),
+ "cp -f %s %s", fpath, tmpbuf);
system(buf);
}
if (pageno)