#include "deftype.h"

unchar *jnstrcpy2(unchar *buff,unchar *str,int max)
/* 見た目の長さ"〜"切り出し */
{
unchar c;
	if ((--max)>0) {
		/* skip to " */
		while (c=*str++,(c!=0 && c!='\"'));
		if (c!=0) {
			/* copy str to buff until 0/"/max */
			while (c=*str,(c!=0 && c!='\"')) {
				if (check_kanji1(c)) {
					if (!is24(c)) if ((--max)==0) break;
					*buff++=c;
					c=*++str;
				}
				*buff++=c;
				str++;
				if ((--max)==0) break;
			}
		}
	}
	*buff=0;
	return(str);
}
