aboutsummaryrefslogtreecommitdiff
path: root/base/commandLine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'base/commandLine.cpp')
-rw-r--r--base/commandLine.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 44007c494a..7f88dc0b63 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -145,7 +145,7 @@ static const char HELP_STRING[] =
static const char *s_appName = "scummvm";
-static void usage(const char *s, ...) GCC_PRINTF(1, 2);
+static void NORETURN_PRE usage(const char *s, ...) GCC_PRINTF(1, 2) NORETURN_POST;
static void usage(const char *s, ...) {
char buf[STRINGBUFLEN];
@@ -314,8 +314,11 @@ void registerDefaults() {
Common::String parseCommandLine(Common::StringMap &settings, int argc, const char * const *argv) {
const char *s, *s2;
+ if (!argv)
+ return Common::String();
+
// argv[0] contains the name of the executable.
- if (argv && argv[0]) {
+ if (argv[0]) {
s = strrchr(argv[0], '/');
s_appName = s ? (s+1) : argv[0];
}
@@ -579,8 +582,7 @@ static void listGames() {
"-------------------- ------------------------------------------------------\n");
const EnginePlugin::List &plugins = EngineMan.getPlugins();
- EnginePlugin::List::const_iterator iter = plugins.begin();
- for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
+ for (EnginePlugin::List::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) {
GameList list = (**iter)->getSupportedGames();
for (GameList::iterator v = list.begin(); v != list.end(); ++v) {
printf("%-20s %s\n", v->gameid().c_str(), v->description().c_str());