emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lib-src/pop.c,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lib-src/pop.c,v
Date: Tue, 22 Jan 2008 15:38:49 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/01/22 15:38:49

Index: pop.c
===================================================================
RCS file: /sources/emacs/emacs/lib-src/pop.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- pop.c       10 Jan 2008 15:33:52 -0000      1.46
+++ pop.c       22 Jan 2008 15:38:49 -0000      1.47
@@ -381,25 +381,18 @@
   errno = 0;
   *count = strtol (&fromserver[4], &end_ptr, 10);
   /* Check validity of string-to-integer conversion. */
-  if (fromserver[4] == 0 || *end_ptr != 0 || errno)
+  if (fromserver + 4 == end_ptr || *end_ptr != ' ' || errno)
     {
       strcpy (pop_error, "Unexpected response from POP server in pop_stat");
       pop_trash (server);
       return (-1);
     }
 
-  fromserver = index (&fromserver[4], ' ');
-  if (! fromserver)
-    {
-      strcpy (pop_error,
-             "Badly formatted response from server in pop_stat");
-      pop_trash (server);
-      return (-1);
-    }
+  fromserver = end_ptr;
 
   errno = 0;
   *size = strtol (fromserver + 1, &end_ptr, 10);
-  if (*(fromserver + 1) == 0 || *end_ptr != 0 || errno)
+  if (fromserver + 1 == end_ptr || errno)
     {
       strcpy (pop_error, "Unexpected response from POP server in pop_stat");
       pop_trash (server);
@@ -933,7 +926,7 @@
       int count;
       errno = 0;
       count = strtol (&fromserver[4], &end_ptr, 10);
-      if (fromserver[4] == 0 || *end_ptr != 0 || errno)
+      if (fromserver + 4 == end_ptr || errno)
        {
          strcpy (pop_error, "Unexpected response from server in pop_last");
          pop_trash (server);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]