summaryrefslogtreecommitdiffstats
path: root/mbbsd/kaede.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/kaede.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/kaede.c')
-rw-r--r--mbbsd/kaede.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mbbsd/kaede.c b/mbbsd/kaede.c
index 41b927c1..b5c1a25e 100644
--- a/mbbsd/kaede.c
+++ b/mbbsd/kaede.c
@@ -1,4 +1,4 @@
-/* $Id: kaede.c,v 1.11 2002/07/21 09:33:34 in2 Exp $ */
+/* $Id: kaede.c,v 1.12 2002/07/22 19:02:00 in2 Exp $ */
#include "bbs.h"
char *
@@ -67,7 +67,7 @@ Rename(char *src, char *dst)
if (!strchr(src, ';') && !strchr(dst, ';'))
//Ptt ¨ ¾¤£¥¿±`«ü¥O
{
- sprintf(buf, "/bin/mv %s %s", src, dst);
+ snprintf(buf, sizeof(buf), "/bin/mv %s %s", src, dst);
system(buf);
}
return -1;
@@ -83,7 +83,7 @@ Link(char *src, char *dst)
if (symlink(dst, src) == 0)
return 0;
- sprintf(cmd, "/bin/cp -R %s %s", src, dst);
+ snprintf(cmd, sizeof(cmd), "/bin/cp -R %s %s", src, dst);
return system(cmd);
}
@@ -94,7 +94,8 @@ my_ctime(const time_t * t)
static char ans[100];
tp = localtime(t);
- sprintf(ans, "%02d/%02d/%02d %02d:%02d:%02d", (tp->tm_year % 100),
- tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min, tp->tm_sec);
+ snprintf(ans, sizeof(ans),
+ "%02d/%02d/%02d %02d:%02d:%02d", (tp->tm_year % 100),
+ tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min, tp->tm_sec);
return ans;
}