summaryrefslogtreecommitdiff
path: root/modules/pam_securetty/pam_securetty.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_securetty/pam_securetty.c')
-rw-r--r--modules/pam_securetty/pam_securetty.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/pam_securetty/pam_securetty.c b/modules/pam_securetty/pam_securetty.c
index 5f2d1bec..04741309 100644
--- a/modules/pam_securetty/pam_securetty.c
+++ b/modules/pam_securetty/pam_securetty.c
@@ -159,11 +159,10 @@ securetty_perform_check (pam_handle_t *pamh, int ctrl,
if (cmdlinefile != NULL) {
char line[LINE_MAX], *p;
- line[0] = 0;
- fgets(line, sizeof(line), cmdlinefile);
+ p = fgets(line, sizeof(line), cmdlinefile);
fclose(cmdlinefile);
- for (p = line; p; p = strstr(p+1, "console=")) {
+ for (; p; p = strstr(p+1, "console=")) {
char *e;
/* Test whether this is a beginning of a word? */