Added password_strncpy() which pads destination with zeros.
This commit is contained in:
parent
9c9e49ac39
commit
2e6197d634
2 changed files with 14 additions and 0 deletions
|
@ -38,3 +38,15 @@ get_best_password(struct password_item *head, int flags)
|
||||||
}
|
}
|
||||||
return best;
|
return best;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
password_strncpy(char *to, char *from, int len)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i=0; i<len; i++) {
|
||||||
|
*to++ = *from;
|
||||||
|
if (*from)
|
||||||
|
from++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,5 +20,7 @@ struct password_item {
|
||||||
extern struct password_item *last_password_item;
|
extern struct password_item *last_password_item;
|
||||||
|
|
||||||
struct password_item *get_best_password(struct password_item *head, int flags);
|
struct password_item *get_best_password(struct password_item *head, int flags);
|
||||||
|
extern void password_strncpy(char *to, char *from, int len);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue