Use strcspn to convert the newline to NUL in fgets results.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11462 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -65,8 +65,7 @@ krb5_prompter_posix (krb5_context context,
|
||||
prompts[i].reply->length,
|
||||
stdin) == NULL)
|
||||
return 1;
|
||||
if(s[strlen(s) - 1] == '\n')
|
||||
s[strlen(s) - 1] = '\0';
|
||||
s[strcspn(s, "\n")] = '\0';
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user