Skip to content
Snippets Groups Projects
Commit 9b9cc7e2 authored by Bill Welliver's avatar Bill Welliver
Browse files

windows: strdup is deprecated.

parent d44644e6
No related branches found
No related tags found
No related merge requests found
src/main.c 100644 → 100755
......@@ -98,7 +98,13 @@ static void set_master(const char *file)
{
if( master_file_location != _master_location+CONSTANT_STRLEN(MASTER_COOKIE))
free((void*)master_file_location);
#if DEBUG_MALLOC
#ifndef __NT__
#undef strdup /* We can't use dmalloc strdup before pike_memory is initialized. */
#else
#define strdup _strdup
#endif /* __NT__ */
#endif /* DEBUG_MALLOC */
master_file_location = strdup( file );
}
......@@ -106,7 +112,7 @@ static void set_master(const char *file)
static void get_master_key(HKEY cat)
{
HKEY k;
char buffer[4096];
char * buffer = malloc(4096);
DWORD len=sizeof(buffer)-1,type=REG_SZ;
if(RegOpenKeyEx(cat,
......@@ -163,7 +169,7 @@ static void set_default_master(const char *bin_name)
fprintf (stderr, "Failed to get path to exe file: %d\n",
GetLastError());
else {
char tmp[MAXPATHLEN * 2];
char * tmp = malloc(MAXPATHLEN * 2);
char *p = strrchr (exepath, '\\');
if (p) *p = 0;
SNPRINTF (tmp, sizeof (tmp), "%s/%s", exepath, mp);
......@@ -295,7 +301,6 @@ int main(int argc, char **argv)
JMP_BUF back;
int e, num;
char *p;
#ifdef PIKE_EXTRA_DEBUG
if (sizeof(void *) == 8) {
/* 64-bit Solaris 10 in Xenofarm fails with SIGPIPE.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment