# | Line 151 | Line 151 | main(int argc, char *argv[]) | |
---|---|---|
151 | ||
152 | if (flag & FLAG_PASS) | |
153 | { | |
154 | < | if (!plaintext) |
154 | > | if (plaintext == NULL) |
155 | > | { |
156 | printf("Please enter a valid password\n"); | |
157 | + | exit(EXIT_FAILURE); |
158 | + | } |
159 | + | } |
160 | + | else if ((plaintext = getpass("plaintext: ")) == NULL) |
161 | + | { |
162 | + | printf("getpass() failed\n"); |
163 | + | exit(EXIT_FAILURE); |
164 | } | |
157 | – | else |
158 | – | plaintext = getpass("plaintext: "); |
165 | ||
166 | if ((ret = crypt(plaintext, salt))) | |
167 | printf("%s\n", ret); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |