Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
ygopro-core
Commits
705e6159
Commit
705e6159
authored
Jun 15, 2025
by
salix5
Committed by
GitHub
Jun 15, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix warning -Wformat-security (#764)
* fix warning -Wformat-security * fix warning C4267
parent
1aed2254
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
13 deletions
+13
-13
card.cpp
card.cpp
+1
-1
interpreter.cpp
interpreter.cpp
+8
-8
libcard.cpp
libcard.cpp
+2
-2
libduel.cpp
libduel.cpp
+1
-1
operations.cpp
operations.cpp
+1
-1
No files found.
card.cpp
View file @
705e6159
...
...
@@ -3484,7 +3484,7 @@ int32_t card::is_special_summonable(uint8_t playerid, uint32_t summon_type, mate
effect_set
eset
;
filter_spsummon_procedure
(
playerid
,
&
eset
,
summon_type
,
info
);
pduel
->
game_field
->
restore_lp_cost
();
return
eset
.
size
();
return
!!
eset
.
size
();
}
int32_t
card
::
is_can_be_special_summoned
(
effect
*
reason_effect
,
uint32_t
sumtype
,
uint8_t
sumpos
,
uint8_t
sumplayer
,
uint8_t
toplayer
,
uint8_t
nocheck
,
uint8_t
nolimit
,
uint32_t
zone
)
{
if
(
reason_effect
->
get_handler
()
==
this
)
...
...
interpreter.cpp
View file @
705e6159
...
...
@@ -265,7 +265,7 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) {
}
int32_t
interpreter
::
call_function
(
int32_t
f
,
uint32_t
param_count
,
int32_t
ret_count
)
{
if
(
!
f
)
{
sprintf
(
pduel
->
strbuffer
,
"
\"
CallFunction
\"
: attempt to call a null function."
);
sprintf
(
pduel
->
strbuffer
,
"
%s"
,
"
\"
CallFunction
\"
: attempt to call a null function."
);
handle_message
(
pduel
,
1
);
params
.
clear
();
return
OPERATION_FAIL
;
...
...
@@ -278,7 +278,7 @@ int32_t interpreter::call_function(int32_t f, uint32_t param_count, int32_t ret_
}
function2value
(
current_state
,
f
);
if
(
!
lua_isfunction
(
current_state
,
-
1
))
{
sprintf
(
pduel
->
strbuffer
,
"
\"
CallFunction
\"
: attempt to call an error function"
);
sprintf
(
pduel
->
strbuffer
,
"
%s"
,
"
\"
CallFunction
\"
: attempt to call an error function"
);
handle_message
(
pduel
,
1
);
lua_pop
(
current_state
,
1
);
params
.
clear
();
...
...
@@ -350,7 +350,7 @@ int32_t interpreter::call_card_function(card* pcard, const char* f, uint32_t par
}
int32_t
interpreter
::
call_code_function
(
uint32_t
code
,
const
char
*
f
,
uint32_t
param_count
,
int32_t
ret_count
)
{
if
(
param_count
!=
params
.
size
())
{
sprintf
(
pduel
->
strbuffer
,
"
\"
CallCodeFunction
\"
: incorrect parameter count"
);
sprintf
(
pduel
->
strbuffer
,
"
%s"
,
"
\"
CallCodeFunction
\"
: incorrect parameter count"
);
handle_message
(
pduel
,
1
);
params
.
clear
();
return
OPERATION_FAIL
;
...
...
@@ -359,7 +359,7 @@ int32_t interpreter::call_code_function(uint32_t code, const char* f, uint32_t p
luaL_checkstack
(
current_state
,
1
,
nullptr
);
lua_getfield
(
current_state
,
-
1
,
f
);
if
(
!
lua_isfunction
(
current_state
,
-
1
))
{
sprintf
(
pduel
->
strbuffer
,
"
\"
CallCodeFunction
\"
: attempt to call an error function"
);
sprintf
(
pduel
->
strbuffer
,
"
%s"
,
"
\"
CallCodeFunction
\"
: attempt to call an error function"
);
handle_message
(
pduel
,
1
);
lua_pop
(
current_state
,
2
);
params
.
clear
();
...
...
@@ -546,13 +546,13 @@ int32_t interpreter::get_function_value(int32_t f, uint32_t param_count, std::ve
int32_t
interpreter
::
call_coroutine
(
int32_t
f
,
uint32_t
param_count
,
int32_t
*
yield_value
,
uint16_t
step
)
{
*
yield_value
=
0
;
if
(
!
f
)
{
sprintf
(
pduel
->
strbuffer
,
"
\"
CallCoroutine
\"
: attempt to call a null function"
);
sprintf
(
pduel
->
strbuffer
,
"
%s"
,
"
\"
CallCoroutine
\"
: attempt to call a null function"
);
handle_message
(
pduel
,
1
);
params
.
clear
();
return
OPERATION_FAIL
;
}
if
(
param_count
!=
params
.
size
())
{
sprintf
(
pduel
->
strbuffer
,
"
\"
CallCoroutine
\"
: incorrect parameter count"
);
sprintf
(
pduel
->
strbuffer
,
"
%s"
,
"
\"
CallCoroutine
\"
: incorrect parameter count"
);
handle_message
(
pduel
,
1
);
params
.
clear
();
return
OPERATION_FAIL
;
...
...
@@ -565,7 +565,7 @@ int32_t interpreter::call_coroutine(int32_t f, uint32_t param_count, int32_t* yi
function2value
(
rthread
,
f
);
if
(
!
lua_isfunction
(
rthread
,
-
1
))
{
luaL_unref
(
lua_state
,
LUA_REGISTRYINDEX
,
threadref
);
sprintf
(
pduel
->
strbuffer
,
"
\"
CallCoroutine
\"
: attempt to call an error function"
);
sprintf
(
pduel
->
strbuffer
,
"
%s"
,
"
\"
CallCoroutine
\"
: attempt to call an error function"
);
handle_message
(
pduel
,
1
);
params
.
clear
();
return
OPERATION_FAIL
;
...
...
@@ -578,7 +578,7 @@ int32_t interpreter::call_coroutine(int32_t f, uint32_t param_count, int32_t* yi
auto
threadref
=
it
->
second
.
second
;
coroutines
.
erase
(
it
);
luaL_unref
(
lua_state
,
LUA_REGISTRYINDEX
,
threadref
);
sprintf
(
pduel
->
strbuffer
,
"
recursive event trigger detected.
"
);
sprintf
(
pduel
->
strbuffer
,
"
%s"
,
"recursive event trigger detected
"
);
handle_message
(
pduel
,
1
);
params
.
clear
();
--
call_depth
;
...
...
libcard.cpp
View file @
705e6159
...
...
@@ -65,7 +65,7 @@ int32_t scriptlib::card_get_fusion_code(lua_State *L) {
pcard
->
filter_effect
(
EFFECT_ADD_FUSION_CODE
,
&
eset
);
for
(
effect_set
::
size_type
i
=
0
;
i
<
eset
.
size
();
++
i
)
lua_pushinteger
(
L
,
eset
[
i
]
->
get_value
(
pcard
));
return
count
+
eset
.
size
();
return
count
+
(
int32_t
)
eset
.
size
();
}
int32_t
scriptlib
::
card_get_link_code
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
...
...
@@ -82,7 +82,7 @@ int32_t scriptlib::card_get_link_code(lua_State *L) {
pcard
->
filter_effect
(
EFFECT_ADD_LINK_CODE
,
&
eset
);
for
(
effect_set
::
size_type
i
=
0
;
i
<
eset
.
size
();
++
i
)
lua_pushinteger
(
L
,
eset
[
i
]
->
get_value
(
pcard
));
return
count
+
eset
.
size
();
return
count
+
(
int32_t
)
eset
.
size
();
}
int32_t
scriptlib
::
card_is_fusion_code
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
...
...
libduel.cpp
View file @
705e6159
...
...
@@ -185,7 +185,7 @@ int32_t scriptlib::duel_get_flag_effect_label(lua_State *L) {
}
for
(
effect_set
::
size_type
i
=
0
;
i
<
eset
.
size
();
++
i
)
lua_pushinteger
(
L
,
eset
[
i
]
->
label
.
size
()
?
eset
[
i
]
->
label
[
0
]
:
0
);
return
eset
.
size
();
return
(
int32_t
)
eset
.
size
();
}
int32_t
scriptlib
::
duel_destroy
(
lua_State
*
L
)
{
check_action_permission
(
L
);
...
...
operations.cpp
View file @
705e6159
...
...
@@ -6321,7 +6321,7 @@ int32_t field::select_tribute_cards(int16_t step, card* target, uint8_t playerid
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
500
);
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
((
uint32_t
)
cancelable
<<
16
)
+
playerid
,
(
core
.
release_cards_ex
.
size
()
<<
16
)
+
core
.
release_cards_ex
.
size
());
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
((
uint32_t
)
cancelable
<<
16
)
+
playerid
,
(
(
uint32_t
)
core
.
release_cards_ex
.
size
()
<<
16
)
|
(
uint32_t
)
core
.
release_cards_ex
.
size
());
return
FALSE
;
}
case
6
:
{
...
...
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