rem: tmp_string = get_value_string(sc, value); plist_top->filename = (char *)malloc(strlen(tmp_string) + 1); strncpy(plist_top->filename, tmp_string, strlen(tmp_string) + 1);
add: plist_top->filename = strdup(get_value_string(sc, value)); plist_top->is_pnp = 1;
context: define_layer(scheme *sc, pointer args){    pointer car_el, cdr_el, name, value;    int layerno;    project_list_t *plist_tmp = NULL;    char *tmp_string;    if (!sc->vptr->is_pair(args)){	GERB_MESSAGE("define-layer!: Too few arguments\n");	return sc->F;    }    car_el = sc->vptr->pair_car(args);    cdr_el = sc->vptr->pair_cdr(args);    if (!sc->vptr->is_integer(car_el) || !sc->vptr->is_number(car_el)) {	GERB_MESSAGE("define-layer!: Layer number missing/incorrect\n");	return sc->F;    }    layerno = sc->vptr->ivalue(car_el);    car_el = sc->vptr->pair_car(cdr_el);    cdr_el = sc->vptr->pair_cdr(cdr_el);    plist_tmp = (project_list_t *)malloc(sizeof(project_list_t));    memset(plist_tmp, 0, sizeof(project_list_t));    plist_tmp->next = plist_top;    plist_top = plist_tmp;    plist_top->layerno = layerno;    while (sc->vptr->is_pair(car_el)) {	name = sc->vptr->pair_car(car_el);	value =  sc->vptr->pair_cdr(car_el);	if (!sc->vptr->is_symbol(name)) {	    GERB_MESSAGE("define-layer!:non-symbol found, ignoring\n");	    goto end_name_value_parse;	}	if (strcmp(sc->vptr->symname(name), "color") == 0) {	    get_color(sc, value, plist_top->rgb);	} else if (strcmp(sc->vptr->symname(name), "filename") == 0) {	    tmp_string = get_value_string(sc, value);	    plist_top->filename = (char *)malloc(strlen(tmp_string) + 1);	    strncpy(plist_top->filename, tmp_string, strlen(tmp_string) + 1);    } else if (strcmp(sc->vptr->symname(name), "pick_and_place") == 0) {	    tmp_string = get_value_string(sc, value);	    plist_top->filename = (char *)malloc(strlen(tmp_string) + 1);	    strncpy(plist_top->filename, tmp_string, strlen(tmp_string) + 1);  	} else if (strcmp(sc->vptr->symname(name), "inverted") == 0) {	    if (value ==  sc->F) {		plist_top->inverted = 0;	    } else if (value == sc->T) {		plist_top->inverted = 1;	    } else {		GERB_MESSAGE("Argument to inverted must be #t or #f\n");	    }	}    end_name_value_parse:	car_el = sc->vptr->pair_car(cdr_el);	cdr_el = sc->vptr->pair_cdr(cdr_el);    }        return sc->NIL;} /* define_layer */