about summary refs log tree commit diff
path: root/mdeliver.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2018-06-08 14:02:50 +0200
committerLeah Neukirchen <leah@vuxu.org>2018-06-08 14:02:50 +0200
commitece271777131069bdb3749692c793d7ca7b0f639 (patch)
tree8cd5e26cc806a3425622fc99fefa0acb7daf5214 /mdeliver.c
parent6eebeaf68fa3a1212fe1b2a58aa625424e2d6056 (diff)
downloadmblaze-ece271777131069bdb3749692c793d7ca7b0f639.tar.gz
mblaze-ece271777131069bdb3749692c793d7ca7b0f639.tar.xz
mblaze-ece271777131069bdb3749692c793d7ca7b0f639.zip
mdeliver: more careful Status: parsing
Diffstat (limited to 'mdeliver.c')
-rw-r--r--mdeliver.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/mdeliver.c b/mdeliver.c
index ea68647..cbd049a 100644
--- a/mdeliver.c
+++ b/mdeliver.c
@@ -115,15 +115,16 @@ tryagain:
 				break;
 
 			if (Mflag && in_header &&
-			    (strncasecmp("status:", line, 6) == 0 ||
-			     strncasecmp("x-status:", line, 8) == 0)) {
+			    (strncasecmp("status:", line, 7) == 0 ||
+			     strncasecmp("x-status:", line, 9) == 0)) {
 				char *v = strchr(line, ':');
-				if (strchr(v, 'F')) statusflags[0] = 'F';
-				if (strchr(v, 'A')) statusflags[1] = 'R';
-				if (strchr(v, 'R')) statusflags[2] = 'S';
-				if (strchr(v, 'D')) statusflags[3] = 'T';
-				if (strchr(v, 'O')) is_old = 1;
-
+				if (v) {
+					if (strchr(v, 'F')) statusflags[0] = 'F';
+					if (strchr(v, 'A')) statusflags[1] = 'R';
+					if (strchr(v, 'R')) statusflags[2] = 'S';
+					if (strchr(v, 'D')) statusflags[3] = 'T';
+					if (strchr(v, 'O')) is_old = 1;
+				}
 				continue;  // drop header
 			}