X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/896f07bf3c08becc06a881f57fb0ad2160819d45..4d5d51e903a42c23800540930244448c4aacae16:/sbr/ruserpass.c diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index 2a1023f8..4b3d81ba 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -136,9 +136,11 @@ ruserpass(const char *host, char **aname, char **apass, int flags) break; } } + fclose(cfile); return; } } + fclose(cfile); } if (!*aname && ! (flags & RUSERPASS_NO_PROMPT_USER)) { @@ -151,7 +153,7 @@ ruserpass(const char *host, char **aname, char **apass, int flags) if ((pp = getpwuid (getuid())) != NULL) myname = pp->pw_name; } - printf("Name (%s:%s): ", host, myname); + printf("Name (%s:%s): ", host ? host : "", myname); if (fgets(tmp, sizeof tmp, stdin) == NULL) { advise ("tmp", "fgets");