OSDN Git Service

* uinfo.cc (pwdgrp::next_num): Remove check for NULL since it is no longer a
authorcgf <cgf>
Mon, 27 Jan 2003 00:31:30 +0000 (00:31 +0000)
committercgf <cgf>
Mon, 27 Jan 2003 00:31:30 +0000 (00:31 +0000)
valid return from next_str.
(pwdgrp::add_line): Duh.  Revert to use strchr.

winsup/cygwin/ChangeLog
winsup/cygwin/uinfo.cc

index b965d82..488eea1 100644 (file)
@@ -1,5 +1,11 @@
 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.
        * 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
index a6831e2..784130f 100644 (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';