summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/lib/strncpy.c
blob: 31b682a1e19f91ab178375455559c53ed6f7cb19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#define _POSIX_SOURCE
#define _XOPEN_SOURCE
#include <sys/types.h>
#include <string.h>
#include "dietfeatures.h"

/* gcc is broken and has a non-SUSv2 compliant internal prototype.
 * This causes it to warn about a type mismatch here.  Ignore it. */
char *strncpy(char *dest, const char *src, size_t n) {
#ifdef WANT_FULL_POSIX_COMPAT
  memset(dest,0,n);
#endif
  memccpy(dest,src,0,n);
  return dest;
}