Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
f25ea40a
Commit
f25ea40a
authored
Jun 15, 2020
by
Brian Wolfe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timers: use snprintf instead of sprintf
parent
f6ac240c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
timers.cc
src/timers.cc
+2
-3
No files found.
src/timers.cc
View file @
f25ea40a
...
@@ -213,9 +213,8 @@ std::string LocalDateTimeString() {
...
@@ -213,9 +213,8 @@ std::string LocalDateTimeString() {
tz_offset_sign
=
'-'
;
tz_offset_sign
=
'-'
;
}
}
// Apply % 100 to hour to guarantee range [0, 99].
tz_len
=
::
snprintf
(
tz_offset
,
sizeof
(
tz_offset
),
"%c%02li:%02li"
,
tz_len
=
::
sprintf
(
tz_offset
,
"%c%02li:%02li"
,
tz_offset_sign
,
tz_offset_sign
,
(
offset_minutes
/
100
),
offset_minutes
%
100
);
(
offset_minutes
/
100
)
%
100
,
offset_minutes
%
100
);
CHECK
(
tz_len
==
6
);
CHECK
(
tz_len
==
6
);
((
void
)
tz_len
);
// Prevent unused variable warning in optimized build.
((
void
)
tz_len
);
// Prevent unused variable warning in optimized build.
}
else
{
}
else
{
...
...
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