#include <stdio.h>
#include <string.h>
#include "defines.h"

void WrLenStr(FILE *fp,unchar *str,int len)
{
#define MAX 256
unchar work[MAX];
int slen;
	if (len>MAX) len=MAX;
	memset(work,0,len);
	slen=strlen(str);
	if (slen<len) strcpy(work,str);
	else memcpy(work,str,len);
	fwrite(work,len,1,fp);
}
