X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/975b8341cc7ff17cbe4a5900b6ed41c47cceed62..d6b2ae5fa68b9a82ffc006c233aef64c5cdb3bd2:/sbr/ruserpass.c diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index 7669f8bb..7038cf5c 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -148,9 +148,11 @@ ruserpass(char *host, char **aname, char **apass) } printf("Name (%s:%s): ", host, myname); - fgets(tmp, sizeof(tmp) - 1, stdin); + if (fgets(tmp, sizeof(tmp) - 1, stdin) == NULL) { + advise ("tmp", "fgets"); + } tmp[strlen(tmp) - 1] = '\0'; - if (*tmp != '\0') { + if (*tmp != '\0' || myname == NULL) { myname = tmp; }