* 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>
|
2003-01-26 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* strings.h (strechr): New function.
|
* strings.h (strechr): New function.
|
||||||
|
|
|
@ -405,8 +405,6 @@ bool
|
||||||
pwdgrp::next_num (unsigned long& n)
|
pwdgrp::next_num (unsigned long& n)
|
||||||
{
|
{
|
||||||
char *p = next_str (':');
|
char *p = next_str (':');
|
||||||
if (!p)
|
|
||||||
return -1;
|
|
||||||
char *cp;
|
char *cp;
|
||||||
n = strtoul (p, &cp, 10);
|
n = strtoul (p, &cp, 10);
|
||||||
return p != cp && !*cp;
|
return p != cp && !*cp;
|
||||||
|
@ -418,8 +416,8 @@ pwdgrp::add_line (char *eptr)
|
||||||
if (eptr)
|
if (eptr)
|
||||||
{
|
{
|
||||||
lptr = eptr;
|
lptr = eptr;
|
||||||
eptr = strechr (lptr, '\n');
|
eptr = strchr (lptr, '\n');
|
||||||
if (*eptr)
|
if (eptr)
|
||||||
{
|
{
|
||||||
if (eptr > lptr && eptr[-1] == '\r')
|
if (eptr > lptr && eptr[-1] == '\r')
|
||||||
eptr[-1] = '\0';
|
eptr[-1] = '\0';
|
||||||
|
|
Loading…
Reference in New Issue