Initial public busybox maemo commit, 3:1.10.2.legal-1osso12
[busybox4maemo] / debian / sfdisk / xstrncpy.c
1 /* NUL-terminated version of strncpy() */
2 #include <string.h>
3 #include "xstrncpy.h"
4
5 /* caller guarantees n > 0 */
6 void
7 xstrncpy(char *dest, const char *src, size_t n) {
8         strncpy(dest, src, n-1);
9         dest[n-1] = 0;
10 }