summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nest/password.c12
-rw-r--r--nest/password.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/nest/password.c b/nest/password.c
index ce7941ea..f0f433ab 100644
--- a/nest/password.c
+++ b/nest/password.c
@@ -38,3 +38,15 @@ get_best_password(struct password_item *head, int flags)
}
return best;
}
+
+void
+password_strncpy(char *to, char *from, int len)
+{
+ int i;
+ for (i=0; i<len; i++) {
+ *to++ = *from;
+ if (*from)
+ from++;
+ }
+}
+
diff --git a/nest/password.h b/nest/password.h
index 16f4385a..119aa707 100644
--- a/nest/password.h
+++ b/nest/password.h
@@ -20,5 +20,7 @@ struct password_item {
extern struct password_item *last_password_item;
struct password_item *get_best_password(struct password_item *head, int flags);
+extern void password_strncpy(char *to, char *from, int len);
+
#endif