* uinfo.cc (pwdgrp::next_num): Remove check for NULL since it is no longer a
valid return from next_str. (pwdgrp::add_line): Duh. Revert to use strchr.
This commit is contained in:
parent
fea48988ea
commit
03dba1defa
|
@ -1,3 +1,9 @@
|
|||
2003-01-26 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* uinfo.cc (pwdgrp::next_num): Remove check for NULL since it is no
|
||||
longer a valid return from next_str.
|
||||
(pwdgrp::add_line): Duh. Revert to use strchr.
|
||||
|
||||
2003-01-26 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* strings.h (strechr): New function.
|
||||
|
|
|
@ -405,8 +405,6 @@ bool
|
|||
pwdgrp::next_num (unsigned long& n)
|
||||
{
|
||||
char *p = next_str (':');
|
||||
if (!p)
|
||||
return -1;
|
||||
char *cp;
|
||||
n = strtoul (p, &cp, 10);
|
||||
return p != cp && !*cp;
|
||||
|
@ -418,8 +416,8 @@ pwdgrp::add_line (char *eptr)
|
|||
if (eptr)
|
||||
{
|
||||
lptr = eptr;
|
||||
eptr = strechr (lptr, '\n');
|
||||
if (*eptr)
|
||||
eptr = strchr (lptr, '\n');
|
||||
if (eptr)
|
||||
{
|
||||
if (eptr > lptr && eptr[-1] == '\r')
|
||||
eptr[-1] = '\0';
|
||||
|
|
Loading…
Reference in New Issue