entered into RCS
authorroland <roland>
Sat, 19 Oct 1991 01:05:29 +0000 (01:05 +0000)
committerroland <roland>
Sat, 19 Oct 1991 01:05:29 +0000 (01:05 +0000)
mach/mig_strncpy.c [new file with mode: 0644]

diff --git a/mach/mig_strncpy.c b/mach/mig_strncpy.c
new file mode 100644 (file)
index 0000000..986fd84
--- /dev/null
@@ -0,0 +1,20 @@
+/* Silly pointless function MiG needs.  */
+
+#include <ansidecl.h>
+#include <string.h>
+
+int
+__mig_strncpy (char *dest, char *src, size_t len)
+{
+  size_t i;
+
+  if (len == 0)
+    return 0;
+
+  for (i = 1; i < len; ++i)
+    if ((*dest++ = *src++) == '\0')
+      return i;
+
+  *dest = '\0';
+  return i;
+}