summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-01-22 15:36:05 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-01-22 15:36:05 +0000
commit3934928475da8aa0300ba939002705023b00b079 (patch)
tree41bc4934ddcba441a658a2a445e2b6520174a222 /lib-src
parentbe2391d0e40a6cb7cba3658a6fdeb45eb077009d (diff)
downloademacs-3934928475da8aa0300ba939002705023b00b079.tar.gz
(pop_stat, pop_last): Fix last fix.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/pop.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 5dc5de75583..7b9b191add7 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -381,25 +381,18 @@ pop_stat (server, count, size)
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 @@ pop_last (server)
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);