Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
2d4654a1
Unverified
Commit
2d4654a1
authored
Nov 21, 2022
by
James Lamb
Committed by
GitHub
Nov 21, 2022
Browse files
prefer 'vsnprintf' to 'vsprintf' (#5561)
parent
61ef3ada
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
include/LightGBM/utils/log.h
include/LightGBM/utils/log.h
+4
-3
No files found.
include/LightGBM/utils/log.h
View file @
2d4654a1
...
...
@@ -109,12 +109,13 @@ class Log {
}
static
void
Fatal
(
const
char
*
format
,
...)
{
va_list
val
;
char
str_buf
[
1024
];
const
size_t
kBufSize
=
1024
;
char
str_buf
[
kBufSize
];
va_start
(
val
,
format
);
#ifdef _MSC_VER
vsprintf_s
(
str_buf
,
format
,
val
);
vs
n
printf_s
(
str_buf
,
kBufSize
,
format
,
val
);
#else
vsprintf
(
str_buf
,
format
,
val
);
vs
n
printf
(
str_buf
,
kBufSize
,
format
,
val
);
#endif
va_end
(
val
);
...
...
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