henesyinit from p9f0ed2a895 years agoHistory
23 lines · 340 B · C
RawDownload
#include "agent.h" voidmemrandom(void *p, int n){	ulong *lp;	uchar *cp; 	for(lp = p; n >= sizeof(ulong); n -= sizeof(ulong))		*lp++ = fastrand();	for(cp = (uchar*)lp; n > 0; n--)		*cp++ = fastrand();} char*safecpy(char *to, char *from, int n){	memset(to, 0, n);	if(n == 1)		return to;	strncpy(to, from, n-1);	return to;}