rem: strcat(rcfile, RCFILE); fp = fopen(rcfile, "r"); if (fp == NULL) { strcpy(Fields, DEFAULT_SHOW); } else { if (fgets(Fields, 254, fp) != NULL) { pt = strchr(Fields, '\n'); if (pt) *pt = 0; } fgets(Options, 254, fp); fclose(fp); }
add: if ( (rcfile = malloc(home_length + strlen(RCFILE) + 2))) { if (home != NULL) { strcpy(rcfile, home); strcat(rcfile, "/"); } strcat(rcfile, RCFILE); fp = fopen(rcfile, "r"); if (fp == NULL) { strcpy(Fields, DEFAULT_SHOW); } else { if (fgets(Fields, 254, fp) != NULL) { pt = strchr(Fields, '\n'); if (pt) *pt = 0; } fgets(Options, 254, fp); fclose(fp); }  free(rcfile); }
context: static void get_options(void){    FILE *fp;    char *pt;    char rcfile[MAXNAMELEN];    char Options[256] = "";    int i;    nr_cpu = sysconf (_SC_NPROCESSORS_ONLN);    cpu_mapping = (int *) xmalloc (sizeof (int) * nr_cpu);    /* read cpuname */    for (i=0; i< nr_cpu; i++) cpu_mapping[i]=i;    header_lines = 6 + nr_cpu;    strcpy(rcfile, SYS_TOPRC);    fp = fopen(rcfile, "r");    if (fp != NULL) {	fgets(Options, 254, fp);	fclose(fp);    }    parse_options(Options, 0);    strcpy(Options, "");    if (getenv("HOME")) {	strcpy(rcfile, getenv("HOME"));	strcat(rcfile, "/");    }    strcat(rcfile, RCFILE);    fp = fopen(rcfile, "r");    if (fp == NULL) {	strcpy(Fields, DEFAULT_SHOW);    } else {	if (fgets(Fields, 254, fp) != NULL) {	    pt = strchr(Fields, '\n');	    if (pt) *pt = 0;	}	fgets(Options, 254, fp);	fclose(fp);    }    parse_options(Options, getuid()? Secure : 0);}