aboutsummaryrefslogtreecommitdiff
path: root/djb/str_copyn.c
blob: 3dab7240dcf3eebc9525186260bdee8e0b9ff254 (plain)
1
2
3
4
5
6
unsigned int str_copyn(char *out,const char *in, unsigned int len) /*EXTRACT_INCL*/ {
  unsigned int k=0;
  while (k<len && (out[k]=in[k])) k++;
  if (k<len) out[k] = 0;
  return k;
}