pike.git / src / main.c

version» Context lines:

pike.git/src/main.c:89: Inside #if undefined(MAXPATHLEN)
     #ifndef MAXPATHLEN   #define MAXPATHLEN 32768   #endif      static const char _master_location[MAXPATHLEN+CONSTANT_STRLEN(MASTER_COOKIE)] = MASTER_COOKIE;   static char *master_file_location = _master_location + CONSTANT_STRLEN(MASTER_COOKIE);      static void set_master(const char *file)   { -  if( master_file_location > _master_location+CONSTANT_STRLEN(MASTER_COOKIE) -  || master_file_location < _master_location) +  if( master_file_location != _master_location+CONSTANT_STRLEN(MASTER_COOKIE))    free(master_file_location);    master_file_location = strdup( file );   }      #ifdef __NT__   static void get_master_key(HKEY cat)   {    HKEY k;    char buffer[4096];    DWORD len=sizeof(buffer)-1,type=REG_SZ;
pike.git/src/main.c:169: Inside #if defined(__NT__)
   char *p = strrchr (exepath, '\\');    if (p) *p = 0;    SNPRINTF (tmp, sizeof (tmp), "%s/%s", exepath, mp);    set_master( tmp );    }    }   #else    if (!*mp) {    /* Attempt to find a master via the path to the binary. */    /* Note: We assume that MAXPATHLEN is > 18 characters. */ -  char tmp[strlen(bin_name)]; +  if (strlen(bin_name) + CONSTANT_STRLEN("master.pike") < MAXPATHLEN) { +  char tmp[MAXPATHLEN];    char *p;    strcpy(tmp, bin_name);    p = strrchr(tmp, '/');    if (!p) p = tmp;    else p++;    strcpy(p, "master.pike");    set_master( tmp );    } -  +  }   #endif       TRACE((stderr, "Default master at \"%s\"...\n", mp));   #undef mp   }      #ifdef LIBPIKE   static char libpike_file[MAXPATHLEN * 2];   static void *libpike;