#include "mcdp.h"

size_t str_len(const unsigned char *str) {
 register size_t n=0;
 if (!str) return 0;
 for (n=0; *str; ++str) ++n;
 return n;
}

size_t str_ncpy(unsigned char *dst, const unsigned char *src, size_t n) {
 register unsigned char *d=dst;
 register const unsigned char *s=src;
 for (n=0;;n++) { if (!(*d=*s)) break; ++d; ++s; }
 return n;
}
