projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed potentially invalid string pointers when parsing options
[rocksndiamonds.git]
/
src
/
init.c
diff --git
a/src/init.c
b/src/init.c
index ffc856e3b3af75322c70130a5bffa4b90ac46043..1674aa56cbc069e99e8547e817f0c0a1e1cd0f96 100644
(file)
--- a/
src/init.c
+++ b/
src/init.c
@@
-5032,18
+5032,20
@@
static void Execute_Command(char *command)
exit(0);
}
exit(0);
}
- else if (strPrefix(command, "autotest ") ||
- strPrefix(command, "autoplay ") ||
+ else if (strPrefix(command, "autoplay ") ||
strPrefix(command, "autoffwd ") ||
strPrefix(command, "autoffwd ") ||
- strPrefix(command, "autowarp "))
+ strPrefix(command, "autowarp ") ||
+ strPrefix(command, "autotest ") ||
+ strPrefix(command, "autofix "))
{
{
- char *str_ptr = getStringCopy(&command[
9
]); // read command parameters
+ char *str_ptr = getStringCopy(&command[
8
]); // read command parameters
global.autoplay_mode =
global.autoplay_mode =
- (strPrefix(command, "autotest") ? AUTOPLAY_MODE_TEST :
- strPrefix(command, "autoplay") ? AUTOPLAY_MODE_PLAY :
+ (strPrefix(command, "autoplay") ? AUTOPLAY_MODE_PLAY :
strPrefix(command, "autoffwd") ? AUTOPLAY_MODE_FFWD :
strPrefix(command, "autowarp") ? AUTOPLAY_MODE_WARP :
strPrefix(command, "autoffwd") ? AUTOPLAY_MODE_FFWD :
strPrefix(command, "autowarp") ? AUTOPLAY_MODE_WARP :
+ strPrefix(command, "autotest") ? AUTOPLAY_MODE_TEST :
+ strPrefix(command, "autofix") ? AUTOPLAY_MODE_FIX :
AUTOPLAY_MODE_NONE);
while (*str_ptr != '\0') // continue parsing string
AUTOPLAY_MODE_NONE);
while (*str_ptr != '\0') // continue parsing string
@@
-5078,7
+5080,7
@@
static void Execute_Command(char *command)
str_ptr++;
}
str_ptr++;
}
- if (global.autoplay_mode
== AUTOPLAY_MODE_TEST
)
+ if (global.autoplay_mode
& AUTOPLAY_WARP_NO_DISPLAY
)
program.headless = TRUE;
}
else if (strPrefix(command, "patch tapes "))
program.headless = TRUE;
}
else if (strPrefix(command, "patch tapes "))
@@
-6224,7
+6226,7
@@
void OpenAll(void)
if (global.autoplay_leveldir)
{
if (global.autoplay_leveldir)
{
- AutoPlayTape();
+ AutoPlayTape
s
();
return;
}
else if (global.patchtapes_leveldir)
return;
}
else if (global.patchtapes_leveldir)