]> diplodocus.org Git - nmh/blobdiff - sbr/ruserpass.c
Merge commit '8206fbf', due to my screwup of committing it on a detached
[nmh] / sbr / ruserpass.c
index 7669f8bb7030cd76243b396004f419950da74721..7038cf5ce4ac87a2f15e0ce8150c5d24343c9c2d 100644 (file)
@@ -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;
        }