summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-01-06 16:45:25 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-01-06 16:45:25 (GMT)
commitecbb8dc17a00dccc1d6d7b0c5bf0b3400736775c (patch)
treebf6f9c151cb2de9613cac4adf7be62177c884495 /Modules
parent003428158bc6cb2bcac766b4394d1519172c22cb (diff)
downloadcpython-ecbb8dc17a00dccc1d6d7b0c5bf0b3400736775c.zip
cpython-ecbb8dc17a00dccc1d6d7b0c5bf0b3400736775c.tar.gz
cpython-ecbb8dc17a00dccc1d6d7b0c5bf0b3400736775c.tar.bz2
Use PyOS_snprintf for better portability.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/timemodule.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index c1f656b..d73b22b 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -605,11 +605,11 @@ _asctime(struct tm *timeptr)
char buf[20]; /* 'Sun Sep 16 01:03:52\0' */
int n;
- n = snprintf(buf, sizeof(buf), "%.3s %.3s%3d %.2d:%.2d:%.2d",
- wday_name[timeptr->tm_wday],
- mon_name[timeptr->tm_mon],
- timeptr->tm_mday, timeptr->tm_hour,
- timeptr->tm_min, timeptr->tm_sec);
+ n = PyOS_snprintf(buf, sizeof(buf), "%.3s %.3s%3d %.2d:%.2d:%.2d",
+ wday_name[timeptr->tm_wday],
+ mon_name[timeptr->tm_mon],
+ timeptr->tm_mday, timeptr->tm_hour,
+ timeptr->tm_min, timeptr->tm_sec);
/* XXX: since the fields used by snprintf above are validated in checktm,
* the following condition should never trigger. We keep the check because
* historically fixed size buffer used in asctime was the source of