Skip to content

Commit 7e9e5c6

Browse files
author
jesperpedersen
committed
Fix warning
1 parent c9e692d commit 7e9e5c6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cli.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,11 @@ main(int argc, char** argv)
438438
printf("User name: ");
439439

440440
memset(&un, 0, sizeof(un));
441-
fgets(&un[0], sizeof(un), stdin);
441+
if (fgets(&un[0], sizeof(un), stdin) == NULL)
442+
{
443+
exit_code = 1;
444+
goto done;
445+
}
442446
un[strlen(un) - 1] = 0;
443447
username = &un[0];
444448
}

0 commit comments

Comments
 (0)