mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 21:52:48 +00:00
Fix #308
This commit is contained in:
parent
79a3bfc9e1
commit
73a8332695
@ -631,6 +631,7 @@ char* find_next(char* ptr) {
|
|||||||
char* find_label(const char* label, const char* last_found) {
|
char* find_label(const char* label, const char* last_found) {
|
||||||
char* script = (char*) script_buffer;
|
char* script = (char*) script_buffer;
|
||||||
char* ptr = script;
|
char* ptr = script;
|
||||||
|
u32 label_len = strnlen(label, _ARG_MAX_LEN);
|
||||||
|
|
||||||
if (last_found) {
|
if (last_found) {
|
||||||
ptr = strchr(last_found, '\n');
|
ptr = strchr(last_found, '\n');
|
||||||
@ -659,7 +660,7 @@ char* find_label(const char* label, const char* last_found) {
|
|||||||
// compare it manually (also check for '*' at end)
|
// compare it manually (also check for '*' at end)
|
||||||
u32 pdiff = 0;
|
u32 pdiff = 0;
|
||||||
for (; (pdiff < str_len) && (label[pdiff] == str[pdiff]); pdiff++);
|
for (; (pdiff < str_len) && (label[pdiff] == str[pdiff]); pdiff++);
|
||||||
if ((pdiff != str_len) && (label[pdiff] != '*')) continue; // no match
|
if ((pdiff < label_len) && (label[pdiff] != '*')) continue; // no match
|
||||||
// otherwise: potential regular or wildcard match
|
// otherwise: potential regular or wildcard match
|
||||||
|
|
||||||
// may be a match, see if there are more strings after it
|
// may be a match, see if there are more strings after it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user