#define LAUNCHER_VERSION_STR __STR(VERSION)
#endif
+#define CMD_LINE_SIZE 24 // sizeof("/usr/bin/dotnet-launcher")
+
static std::string VersionOption("--version");
static std::string StandaloneOption("--standalone");
int i;
bool standalone = false;
char* standalonePath = nullptr;
- int cmdlineSize = 0;
std::vector<char*> vargs;
return 1;
}
i++;
- standalonePath = strdup(argv[i]);
+ standalonePath = argv[i];
} else {
vargs.push_back(argv[i]);
}
- cmdlineSize += (strlen(argv[i]) +1);
}
using tizen::runtime::LauncherInterface;
}
// change cmdline from dotnet-launcher to executable path
- memset(argv[0], '\0', cmdlineSize);
- snprintf(argv[0], cmdlineSize, "%s", standalonePath);
+ memset(argv[0], '\0', CMD_LINE_SIZE);
+ snprintf(argv[0], CMD_LINE_SIZE - 1, "%s", appId);
int argsLen = vargs.size();
char** args = &vargs[0];
Launchpad.loaderMain(argc, argv);
}
- if (standalonePath != nullptr) {
- free(standalonePath);
- }
-
runtime->dispose();
return 0;
}