summaryrefslogtreecommitdiffstats
path: root/nest
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>1999-05-31 21:15:52 +0200
committerPavel Machek <pavel@ucw.cz>1999-05-31 21:15:52 +0200
commit2e6197d634a14533899915477032f082e675e35f (patch)
tree3c53b76032896ffae20fa39532b30863363b0c1c /nest
parent9c9e49ac392dfdbff97be579842028a4eb1d0dec (diff)
downloadbird-2e6197d634a14533899915477032f082e675e35f.tar
bird-2e6197d634a14533899915477032f082e675e35f.zip
Added password_strncpy() which pads destination with zeros.
Diffstat (limited to 'nest')
-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 ce7941e..f0f433a 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 16f4385..119aa70 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