aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rfc822.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rfc822.c b/rfc822.c
index 5e335616..99c78c0e 100644
--- a/rfc822.c
+++ b/rfc822.c
@@ -264,7 +264,8 @@ unsigned char *nxtaddr(const unsigned char *hdr /* header to be parsed, NUL to c
state = ENDIT_ALL;
if (tp)
{
- while (isspace(address[--tp]))
+ --tp;
+ while (tp >= 0 && isspace(address[tp--]))
continue;
address[++tp] = '\0';
tp = 0;