strcpy(docname, midiname, 256); 
strncpy(docname, midiname, sizeof docname - 1); docname[sizeof docname - 1] = '\0'; 
static int	message_DocWin(int message, long param){		switch(message){	case MW_GROW:		{			Rect rect;			rect=win.ref->portRect;			//rect.right-=15; rect.bottom-=15;			rect = win.ref->portRect;			rect.right  -= 16;			//rect.bottom -= 15;			(**gDocTE).viewRect= (**gDocTE).destRect= rect;			//(**gDocTE).destRect.right = (**gDocTE).destRect.right - 14;			TECalText(gDocTE);			TESetSelect((**gDocTE).teLength, (**gDocTE).teLength, gDocTE);			return 0;		}	case MW_DOC_SET:		{			const char	*midiname=(char*)param;			char		*p, docname[256];			//midiname= (char*)param;		    strcpy(docname, midiname, 256);	    	if((p = strrchr(docname, '.')) == NULL){				return 0;		    }            else if(p - docname >= 256 - 4) {                /* cannot strcpy: that cause buffer overrun */            }		    if('A' <= p[1] && p[1] <= 'Z')	strcpy(p + 1, "DOC");	    						else		strcpy(p + 1, "doc");	    	TEReadFile( docname, gDocTE );			break;		}	}	return -1;  //not supported}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/8631152aa5125155bbccb1f49ceabab7016c2e25/mac_c.c/clean/interface/mac_c.c