rem: ptr = fname; bptr = before; while (*ptr) { if(*ptr == '-') { *bptr = 0; if(part==which) bptr = prop; else if(part==which+1) bptr = after; *bptr++ = *ptr; part++; } else { *bptr++ = *ptr; }  ptr++; }*bptr = 0; snprintf(fname, 255, "%s-%s%s", before, newprop, after);
add: if(!fname || !prop) return;  ptr = fname; bptr = before; while (*ptr) { if(*ptr == '-') { *bptr = 0; if(part==which) bptr = prop; else if(part==which+1) bptr = after; *bptr++ = *ptr; part++; } else { *bptr++ = *ptr; } ptr++; } *bptr = 0; snprintf(fname, 255, "%s-%s%s", before, newprop, after);
context: changeFontProp(char *fname, char *newprop, int which){	char before[128], prop[128], after[128];	char *ptr, *bptr;	int part=0;		if(!fname || !prop)		return;	ptr = fname;	bptr = before;	while (*ptr) {		if(*ptr == '-') {    	    *bptr = 0;			if(part==which) bptr = prop;			else if(part==which+1) bptr = after;    	  	*bptr++ = *ptr;			part++;		} else {    	  *bptr++ = *ptr;		}  ptr++;	}*bptr = 0;	snprintf(fname, 255, "%s-%s%s", before, newprop, after); }