Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ecbb8dc1
Commit
ecbb8dc1
authored
Jan 06, 2011
by
Alexander Belopolsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use PyOS_snprintf for better portability.
parent
00342815
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Modules/timemodule.c
Modules/timemodule.c
+5
-5
No files found.
Modules/timemodule.c
View file @
ecbb8dc1
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment