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
a2f2a28b
Commit
a2f2a28b
authored
Oct 09, 2015
by
Anton Danielsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed date format to ISO 8601.
parent
032c190c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
string_util.cc
src/string_util.cc
+2
-2
No files found.
src/string_util.cc
View file @
a2f2a28b
...
@@ -128,7 +128,7 @@ std::string StringPrintFImp(const char *msg, va_list args)
...
@@ -128,7 +128,7 @@ std::string StringPrintFImp(const char *msg, va_list args)
// allocation guess what the size might be
// allocation guess what the size might be
std
::
array
<
char
,
256
>
local_buff
;
std
::
array
<
char
,
256
>
local_buff
;
std
::
size_t
size
=
local_buff
.
size
();
std
::
size_t
size
=
local_buff
.
size
();
//
8/10/2015
: vsnprintf is used instead of snd::vsnprintf due to a limitation in the android-ndk
//
2015-10-08
: vsnprintf is used instead of snd::vsnprintf due to a limitation in the android-ndk
auto
ret
=
vsnprintf
(
local_buff
.
data
(),
size
,
msg
,
args_cp
);
auto
ret
=
vsnprintf
(
local_buff
.
data
(),
size
,
msg
,
args_cp
);
va_end
(
args_cp
);
va_end
(
args_cp
);
...
@@ -143,7 +143,7 @@ std::string StringPrintFImp(const char *msg, va_list args)
...
@@ -143,7 +143,7 @@ std::string StringPrintFImp(const char *msg, va_list args)
// add 1 to size to account for null-byte in size cast to prevent overflow
// add 1 to size to account for null-byte in size cast to prevent overflow
size
=
static_cast
<
std
::
size_t
>
(
ret
)
+
1
;
size
=
static_cast
<
std
::
size_t
>
(
ret
)
+
1
;
auto
buff_ptr
=
std
::
unique_ptr
<
char
[]
>
(
new
char
[
size
]);
auto
buff_ptr
=
std
::
unique_ptr
<
char
[]
>
(
new
char
[
size
]);
//
8/10/2015
: vsnprintf is used instead of snd::vsnprintf due to a limitation in the android-ndk
//
2015-10-08
: vsnprintf is used instead of snd::vsnprintf due to a limitation in the android-ndk
ret
=
vsnprintf
(
buff_ptr
.
get
(),
size
,
msg
,
args
);
ret
=
vsnprintf
(
buff_ptr
.
get
(),
size
,
msg
,
args
);
return
std
::
string
(
buff_ptr
.
get
());
return
std
::
string
(
buff_ptr
.
get
());
}
}
...
...
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