summary refs log tree commit diff
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/parse.c b/parse.c
index 8d3205d..ff97789 100644
--- a/parse.c
+++ b/parse.c
@@ -66,20 +66,22 @@ void parseEnvelope(struct Envelope *envelope, struct List list) {
 		errx(EX_PROTOCOL, "missing envelope structure fields");
 	}
 
-	struct tm tm;
+	
+	struct tm time;
 	const char *date = dataCheck(list.ptr[Date], String).string;
+	envelope->date = date;
 	if (isalpha(date[0])) {
-		date = strptime(date, "%a, %e %b %Y %H:%M:%S ", &tm);
+		date = strptime(date, "%a, %e %b %Y %H:%M:%S ", &time);
 	} else {
-		date = strptime(date, "%e %b %Y %H:%M:%S ", &tm);
+		date = strptime(date, "%e %b %Y %H:%M:%S ", &time);
 	}
 	if (date && (date[0] == '+' || date[0] == '-')) {
-		date = strptime(date, "%z", &tm);
+		date = strptime(date, "%z", &time);
 	} else if (date) {
-		date = strptime(date, "%Z", &tm);
+		date = strptime(date, "%Z", &time);
 	}
 	if (!date) errx(EX_PROTOCOL, "invalid envelope date format");
-	envelope->date = mktime(&tm);
+	envelope->time = mktime(&time);
 
 	// TODO: Decode UTF-8 in subject.
 	envelope->subject = strdup(dataCheck(list.ptr[Subject], String).string);