diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp
index 7a6748fdc..06bcf6b58 100644
--- a/src/c_dispatch.cpp
+++ b/src/c_dispatch.cpp
@@ -694,7 +694,7 @@ void C_DoCommand (const char *cmd, int keynum)
 			}
 			else
 			{
-				Printf ("Unknown command \"%.*s\"\n", len, beg);
+				Printf ("Unknown command \"%.*s\"\n", (int)len, beg);
 			}
 		}
 	}
diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp
index 41ad71472..8debb69a4 100644
--- a/src/d_dehacked.cpp
+++ b/src/d_dehacked.cpp
@@ -2455,6 +2455,12 @@ static bool DoDehPatch()
 			Printf (PRINT_BOLD, "\"%s\" is an old and unsupported DeHackEd patch\n", PatchFile);
 			return false;
 		}
+		// fix for broken WolfenDoom patches which contain \0 characters in some places.
+		for (int i = 0; i < PatchSize; i++)
+		{
+			if (PatchFile[i] == 0) PatchFile[i] = ' ';	
+		}
+
 		PatchPt = strchr (PatchFile, '\n');
 		while ((cont = GetLine()) == 1)
 		{