#include "includes.h"
-RCSID("$Id$");
-
#ifdef HAVE_CYGWIN
#include <fcntl.h>
{ NL("COMMONPROGRAMFILES=") },
{ NL("COMPUTERNAME=") },
{ NL("COMSPEC=") },
+ { NL("CYGWIN=") },
{ NL("NUMBER_OF_PROCESSORS=") },
{ NL("OS=") },
{ NL("PATH=") },
{ NL("SYSTEMROOT=") },
{ NL("TMP=") },
{ NL("TEMP=") },
- { NL("WINDIR=") },
+ { NL("WINDIR=") }
};
char **
fetch_windows_environment(void)
{
char **e, **p;
- int i, idx = 0;
+ unsigned int i, idx = 0;
- p = xmalloc(WENV_SIZ * sizeof(char *));
+ p = xcalloc(WENV_SIZ + 1, sizeof(char *));
for (e = environ; *e != NULL; ++e) {
for (i = 0; i < WENV_SIZ; ++i) {
if (!strncmp(*e, wenv_arr[i].name, wenv_arr[i].namelen))