Blame kpartx/xstrncpy.c

Packit Service 0af388
/* NUL-terminated version of strncpy() */
Packit Service 0af388
#include <string.h>
Packit Service 0af388
#include "xstrncpy.h"
Packit Service 0af388
Packit Service 0af388
/* caller guarantees n > 0 */
Packit Service 0af388
void
Packit Service 0af388
xstrncpy(char *dest, const char *src, size_t n) {
Packit Service 0af388
	strncpy(dest, src, n-1);
Packit Service 0af388
	dest[n-1] = 0;
Packit Service 0af388
}