(login): initialize tmp before calling fgets

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8163 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2000-04-11 00:18:38 +00:00
parent 21f86bc5f7
commit fb26f178f9

View File

@@ -190,8 +190,9 @@ login (char *host)
printf ("Name (%s:%s): ", host, myname);
else
printf ("Name (%s): ", host);
fgets (tmp, sizeof (tmp) - 1, stdin);
tmp[strlen (tmp) - 1] = '\0';
*tmp = '\0';
if (fgets (tmp, sizeof (tmp) - 1, stdin) != NULL)
tmp[strlen (tmp) - 1] = '\0';
if (*tmp == '\0')
user = myname;
else