* 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:
Christopher Faylor 2003-01-27 00:31:30 +00:00
parent fea48988ea
commit 03dba1defa
2 changed files with 8 additions and 4 deletions

View File

@ -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.

View File

@ -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';