(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:
@@ -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
|
||||
|
Reference in New Issue
Block a user