]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Added password_strncpy() which pads destination with zeros.
authorPavel Machek <pavel@ucw.cz>
Mon, 31 May 1999 19:15:52 +0000 (19:15 +0000)
committerPavel Machek <pavel@ucw.cz>
Mon, 31 May 1999 19:15:52 +0000 (19:15 +0000)
nest/password.c
nest/password.h

index ce7941ea88a2e9b16aa41d745a8b84af6e0cb735..f0f433abe8df25c24aea612be4529f33eec975c1 100644 (file)
@@ -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++;
+  }
+}
+
index 16f4385a176bcee2a97fbb2657d11ff4fcf31cd9..119aa707a29c662adede72db82ddc5e0c8bca05b 100644 (file)
@@ -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