Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortherzok <marius.ungureanu@xamarin.com>2019-08-28 12:05:11 +0300
committertherzok <marius.ungureanu@xamarin.com>2019-08-28 12:05:11 +0300
commit79e6ffc04b56de6196b75f26ef1095f03d879233 (patch)
treed36524023701d3476c476dc5c0f4b32d250c5440 /main/build
parent7dd04927b685f53ed5fe12d54026f6cafd7156f1 (diff)
[Mac] Sanify new_argc
Diffstat (limited to 'main/build')
-rw-r--r--main/build/MacOSX/monostub.mm8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/build/MacOSX/monostub.mm b/main/build/MacOSX/monostub.mm
index 81913bf30c..5d2a8cb2da 100644
--- a/main/build/MacOSX/monostub.mm
+++ b/main/build/MacOSX/monostub.mm
@@ -314,9 +314,11 @@ main (int argc, char **argv)
_g_free (mono_version);
- // prepend --debug, MonoDevelop.exe
- new_argc = argc + 2;
- new_argv = (char **) malloc (sizeof (char *) * new_argc);
+ new_argc = 1 // argv[0]
+ + 1 // --debug
+ + 1 // executable name
+ + (argc - 1); // initial arguments - argv[0]
+ new_argv = (char **) malloc (sizeof (char *) * (new_argc + 1)); // add null terminator
int n = 0;
new_argv[n++] = argv[0];