reactos/lib/msvcrt/stdlib
diff -u -r1.9 -r1.10
--- putenv.c 27 Aug 2004 03:08:23 -0000 1.9
+++ putenv.c 31 Aug 2004 14:40:50 -0000 1.10
@@ -16,11 +16,11 @@
int size, result;
wchar_t *woption;
- size = MultiByteToWideChar(CP_ACP, 0, val, 0, NULL, 0);
- woption = malloc(size);
+ size = MultiByteToWideChar(CP_ACP, 0, val, -1, NULL, 0);
+ woption = malloc(size* sizeof(wchar_t));
if (woption == NULL)
return -1;
- MultiByteToWideChar(CP_ACP, 0, val, 0, woption, size);
+ MultiByteToWideChar(CP_ACP, 0, val, -1, woption, size);
result = SetEnv(woption);
free(woption);
return result;
reactos/lib/msvcrt/misc
diff -u -r1.10 -r1.11
--- environ.c 27 Aug 2004 03:08:23 -0000 1.10
+++ environ.c 31 Aug 2004 14:40:50 -0000 1.11
@@ -1,4 +1,4 @@
-/* $Id: environ.c,v 1.10 2004/08/27 03:08:23 navaraf Exp $
+/* $Id: environ.c,v 1.11 2004/08/31 14:40:50 hbirr Exp $
*
* dllmain.c
*
@@ -232,7 +232,7 @@
}
/* Create a copy of the option name. */
- name = malloc(epos - option + 1);
+ name = malloc((epos - option + 1) * sizeof(wchar_t));
if (name == NULL)
return -1;
memcpy(name, option, (epos - option) * sizeof(wchar_t));
@@ -285,7 +285,7 @@
}
/* Create a multibyte copy of the option. */
- size = WideCharToMultiByte(CP_ACP, 0, option, 0, NULL, 0, NULL, NULL);
+ size = WideCharToMultiByte(CP_ACP, 0, option, -1, NULL, 0, NULL, NULL);
mboption = malloc(size);
if (mboption == NULL)
{
@@ -293,7 +293,7 @@
free(woption);
return -1;
}
- WideCharToMultiByte(CP_ACP, 0, option, 0, mboption, size, NULL, NULL);
+ WideCharToMultiByte(CP_ACP, 0, option, -1, mboption, size, NULL, NULL);
if (found)
{