summaryrefslogtreecommitdiff
path: root/nest/password.c
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>1999-05-31 19:15:52 +0000
committerPavel Machek <pavel@ucw.cz>1999-05-31 19:15:52 +0000
commit2e6197d634a14533899915477032f082e675e35f (patch)
tree3c53b76032896ffae20fa39532b30863363b0c1c /nest/password.c
parent9c9e49ac392dfdbff97be579842028a4eb1d0dec (diff)
Added password_strncpy() which pads destination with zeros.
Diffstat (limited to 'nest/password.c')
-rw-r--r--nest/password.c12
1 files changed, 12 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++;
+ }
+}
+