* passwd.cc (pwdgrp::parse_passwd): Eliminate use of memset. The structure

should always be completely filled out.
* grp.cc (pwdgrp::parse_group): Ditto.
* grp.cc (pwdgrp::parse_group): Fix off-by-one problem in allocating
This commit is contained in:
Christopher Faylor
2003-01-26 06:02:34 +00:00
parent c913339563
commit bdbd7fb6b9
3 changed files with 8 additions and 10 deletions

View File

@@ -36,12 +36,7 @@ static char * NO_COPY null_ptr;
bool
pwdgrp::parse_group ()
{
char *dp;
# define grp (*group_buf)[curr_lines]
memset (&grp, 0, sizeof (grp));
grp.gr_name = next_str ();
if (!*grp.gr_name)
return false;
@@ -52,7 +47,7 @@ pwdgrp::parse_group ()
return false;
int n;
dp = raw_ptr ();
char *dp = raw_ptr ();
for (n = 0; *next_str (','); n++)
continue;