Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
a5616c5d
Commit
a5616c5d
authored
Mar 01, 2016
by
BRAMAS Berenger
Browse files
oups forgot the str length in snprintf
parent
3cf5aff6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Src/GroupTree/StarPUUtils/FStarPUTaskNameParams.hpp
View file @
a5616c5d
...
...
@@ -34,7 +34,7 @@ public:
const
char
*
print
(
const
char
format
[],
Params
...
args
){
const
size_t
length
=
512
;
char
*
name
=
new
char
[
length
+
1
];
snprintf
(
name
,
format
,
args
...);
snprintf
(
name
,
length
,
format
,
args
...);
name
[
length
]
=
'\0'
;
names
.
push_back
(
name
);
return
name
;
...
...
@@ -43,7 +43,7 @@ public:
const
char
*
add
(
const
char
*
strToCpy
){
const
size_t
length
=
strlen
(
strToCpy
);
char
*
cpy
=
new
char
[
length
+
1
];
memcpy
(
cpy
,
strToCpy
,
length
);
memcpy
(
cpy
,
length
,
strToCpy
,
length
);
cpy
[
length
]
=
'\0'
;
names
.
push_back
(
cpy
);
return
cpy
;
...
...
Write
Preview
Supports
Markdown
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