* strings.h (strechr): New function.
* uinfo.cc (pwdgrp::next_str): Search only for input char in string. Return EOS on failure. Don't check for NULL since it shouldn't be possible. (pwdgrp::add_line): Revert to replacing '\n' in input line with '\0'. (pwdgrp::next_num): Pass explicit separator character to next_str. * grp.cc (pwdgrp::parse_group): Ditto. * passwd.cc (pwdgrp::parse_passwd): Ditto. Revamp test for garbage input. * pwdgrp.h (pwdgrp::next_str): Don't use default parameter.
This commit is contained in:
@@ -37,11 +37,11 @@ bool
|
||||
pwdgrp::parse_group ()
|
||||
{
|
||||
# define grp (*group_buf)[curr_lines]
|
||||
grp.gr_name = next_str ();
|
||||
grp.gr_name = next_str (':');
|
||||
if (!*grp.gr_name)
|
||||
return false;
|
||||
|
||||
grp.gr_passwd = next_str ();
|
||||
grp.gr_passwd = next_str (':');
|
||||
|
||||
if (!next_num (grp.gr_gid))
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user