summaryrefslogtreecommitdiffstats
path: root/win/tclAppInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclAppInit.c')
-rw-r--r--win/tclAppInit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/win/tclAppInit.c b/win/tclAppInit.c
index 3292335..3e95e3b 100644
--- a/win/tclAppInit.c
+++ b/win/tclAppInit.c
@@ -90,14 +90,16 @@ main(
char *dummy[]) /* Not used. */
{
TCHAR **argv;
+ TCHAR *p;
+ (void)dummy;
#else
int
_tmain(
int argc, /* Number of command-line arguments. */
TCHAR *argv[]) /* Values of command-line arguments. */
{
-#endif
TCHAR *p;
+#endif
/*
* Set up the default locale to be standard "C" locale so parsing is
@@ -270,7 +272,7 @@ setargv(
/* Make sure we don't call Tcl_Alloc through the (not yet initialized) stub table */
# undef Tcl_Alloc
- argSpace = Tcl_Alloc(size * sizeof(char *)
+ argSpace = (TCHAR *)Tcl_Alloc(size * sizeof(char *)
+ (_tcslen(cmdLine) * sizeof(TCHAR)) + sizeof(TCHAR));
argv = (TCHAR **) argSpace;
argSpace += size * (sizeof(char *)/sizeof(TCHAR));