$OpenBSD: patch-mmail_bw_cc,v 1.1.1.1 2016/03/14 19:04:40 awolk Exp $
--- mmail/bw.cc.orig	Thu Jul  3 18:00:30 2003
+++ mmail/bw.cc	Thu Jan 14 12:53:25 2016
@@ -1014,15 +1014,21 @@ bool bwreply::makeOffConfig()
 
 	if (oldstyle) {
 		PDQ_HEADER pdqhead;
+		int i;
 
-		memset(&pdqhead, 0, sizeof pdqhead);
-		memcpy(&pdqhead, infoHeader.keywords,
-			sizeof infoHeader.keywords +
-			sizeof infoHeader.filters +
-			sizeof infoHeader.macros);
+		memcpy(pdqhead.keywords, infoHeader.keywords,
+		       sizeof infoHeader.keywords);
+
+		memcpy(pdqhead.filters, infoHeader.filters,
+		       sizeof infoHeader.filters);
+		for (i = 0; i < 3; i++) {
+			strncpy((char *) pdqhead.macros[i],
+			        (const char *) infoHeader.macros[i], 77);
+			pdqhead.macros[i][77] = '\0';
+		}
 		memcpy(pdqhead.password, infoHeader.password,
-			sizeof infoHeader.password +
-			sizeof infoHeader.passtype);
+		       sizeof infoHeader.password);
+		pdqhead.passtype = infoHeader.passtype;
 
 		int oflags = getshort(infoHeader.uflags);
 		oflags |= PDQ_AREA_CHANGES;
