|
2 | 2 | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
3 | 3 | * Portions Copyright (c) 1994, Regents of the University of California
|
4 | 4 | *
|
5 |
| - * $Id: password.c,v 1.32 2000/08/2721:50:18 tgl Exp $ |
| 5 | + * $Id: password.c,v 1.33 2000/11/2703:43:49 tgl Exp $ |
6 | 6 | *
|
7 | 7 | */
|
8 | 8 |
|
@@ -56,9 +56,11 @@ verify_password(const Port *port, const char *user, const char *password)
|
56 | 56 | *test_user,
|
57 | 57 | *test_pw;
|
58 | 58 |
|
59 |
| -fgets(pw_file_line,sizeof(pw_file_line),pw_file); |
| 59 | +if (fgets(pw_file_line,sizeof(pw_file_line),pw_file)==NULL) |
| 60 | +pw_file_line[0]='\0'; |
60 | 61 | /* kill the newline */
|
61 |
| -if (pw_file_line[strlen(pw_file_line)-1]=='\n') |
| 62 | +if (strlen(pw_file_line)>0&& |
| 63 | +pw_file_line[strlen(pw_file_line)-1]=='\n') |
62 | 64 | pw_file_line[strlen(pw_file_line)-1]='\0';
|
63 | 65 |
|
64 | 66 | p=pw_file_line;
|
|