Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
5479adc8
Commit
5479adc8
authored
Jun 27, 2019
by
Adrian Perez
Committed by
Wouter van Oortmerssen
Jun 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for FLATBUFFERS_PREFER_PRINTF writing zero-length strings (#5418)
parent
b7012484
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
util.h
include/flatbuffers/util.h
+1
-1
No files found.
include/flatbuffers/util.h
View file @
5479adc8
...
...
@@ -102,7 +102,7 @@ std::string NumToStringImplWrapper(T t, const char *fmt, int precision = 0) {
size_t
string_width
=
NumToStringWidth
(
t
,
precision
);
std
::
string
s
(
string_width
,
0x00
);
// Allow snprintf to use std::string trailing null to detect buffer overflow
snprintf
(
const_cast
<
char
*>
(
s
.
data
()),
(
s
.
size
()
+
1
),
fmt
,
precision
,
t
);
snprintf
(
const_cast
<
char
*>
(
s
.
data
()),
(
s
.
size
()
+
1
),
fmt
,
string_width
,
t
);
return
s
;
}
#endif // FLATBUFFERS_PREFER_PRINTF
...
...
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