void printc(char val);

char *_strncpy(char *dst, char *src, int len)
{
  int i, over = 0;
  for (i = 0; i < len; i++) {
    if (over) {
      dst[i] = '\0';
    } else {
      dst[i] = src[i];
      if (src[i] == '\0')
	over = 1;
    }
  }
  return dst;
}

int main()
{
  char s[16];
  int i;

  for (i = 0; i < sizeof(s); i++)
    s[i] = '0' + i;
  for (i = 0; i < sizeof(s); i++)
    printc(s[i] ? s[i] : '.');

  _strncpy(s, "abcdefg", sizeof(s));
  for (i = 0; i < sizeof(s); i++)
    printc(s[i] ? s[i] : '.');

  for (i = 0; i < sizeof(s); i++)
    s[i] = '0' + i;

  _strncpy(s, "abcdefghijklmnopqrstuvwxyz", sizeof(s));
  for (i = 0; i < sizeof(s); i++)
    printc(s[i] ? s[i] : '.');

  return 0;
}
