diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2008-01-22 15:38:49 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2008-01-22 15:38:49 +0000 |
commit | 59a431d6ee62d1d30a737eeb0927ab00c7c5ff4b (patch) | |
tree | 465dc4ec419faa2eee335f9fa341b763e8dad42e /lib-src/pop.c | |
parent | 702123a8235c5590d9b16365d6131b9bcc1f54a4 (diff) | |
download | emacs-59a431d6ee62d1d30a737eeb0927ab00c7c5ff4b.tar.gz |
(pop_stat, pop_last): Fix last fix.
Diffstat (limited to 'lib-src/pop.c')
-rw-r--r-- | lib-src/pop.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/lib-src/pop.c b/lib-src/pop.c index 814575f06d5..f15a3fb23b6 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); |