summaryrefslogtreecommitdiff
path: root/sys/src/libauthsrv/passtokey.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-07-31 20:04:02 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-07-31 20:04:02 +0200
commitcf37a1010f7c9aabce1d3598d5a62489eb01d48c (patch)
treeab850b791e22ff243c0fa37dec7d757f0cba8cfb /sys/src/libauthsrv/passtokey.c
parentd91c4e407d4fa98101ade0bcdc524c1f6864b2e5 (diff)
libauthsrv: export common readcons() routine and introduce PASSWDLEN constant
drawterm, factotum, secstore and the auth commands all had ther own implementation of readcons. we want to have one common function for this to avoid the duplication, so putting that in libauthsrv. introduce PASSWDLEN which makes the use more explicit than ANAMELEN.
Diffstat (limited to 'sys/src/libauthsrv/passtokey.c')
-rw-r--r--sys/src/libauthsrv/passtokey.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/libauthsrv/passtokey.c b/sys/src/libauthsrv/passtokey.c
index 60742c49c..e6803427a 100644
--- a/sys/src/libauthsrv/passtokey.c
+++ b/sys/src/libauthsrv/passtokey.c
@@ -6,12 +6,12 @@
void
passtodeskey(char key[DESKEYLEN], char *p)
{
- uchar buf[ANAMELEN], *t;
+ uchar buf[PASSWDLEN], *t;
int i, n;
n = strlen(p);
- if(n >= ANAMELEN)
- n = ANAMELEN-1;
+ if(n >= PASSWDLEN)
+ n = PASSWDLEN-1;
memset(buf, ' ', 8);
t = buf;
strncpy((char*)t, p, n);