Fix build in 5.1 tree

Change-Id: Id1205f0dda771500f02195c53c5d49bb14c83fac
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 13a488c..94b62c8 100755
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -2893,7 +2893,7 @@
 	// now it's ABX (Android Binary Xml). Sadly, rapidxml can't parse it, so check xml format firstly
 	std::string path = "/data/system/storage.xml";
 	if ((atoi(TWFunc::System_Property_Get("ro.build.version.sdk").c_str()) > 30) && TWFunc::Path_Exists(path))
-		if(!TWFunc::Check_Xml_Format(path)) {
+		if(!TWFunc::Check_Xml_Format(path.c_str())) {
 			LOGINFO("Android 12+: storage.xml is in ABX format. Skipping adopted storage decryption\n");
 			return false;
 		}
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 945f61d..96163f1 100755
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -1522,7 +1522,7 @@
 	return TW_DEFAULT_RECOVERY_FOLDER;
 }
 
-bool TWFunc::Check_Xml_Format(const std::string filename) {
+bool TWFunc::Check_Xml_Format(const char* filename) {
 	std::string buffer(' ', 4);
 	std::string abx_hdr("ABX\x00", 4);
 	std::ifstream File;
diff --git a/twrp-functions.hpp b/twrp-functions.hpp
index 4f3c505..e61038e 100755
--- a/twrp-functions.hpp
+++ b/twrp-functions.hpp
@@ -127,7 +127,7 @@
 	static bool Set_Encryption_Policy(std::string path, const ext4_encryption_policy &policy); // set encryption policy for path
 #endif
 	static string Check_For_TwrpFolder();
-	static bool Check_Xml_Format(const std::string filename); // Return whether a xml is in plain xml or ABX format
+	static bool Check_Xml_Format(const char* filename); // Return whether a xml is in plain xml or ABX format
 
 private:
 	static void Copy_Log(string Source, string Destination);
diff --git a/twrpRepacker.cpp b/twrpRepacker.cpp
index 5164567..ed1bbbc 100755
--- a/twrpRepacker.cpp
+++ b/twrpRepacker.cpp
@@ -16,6 +16,7 @@
 	along with TWRP.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <algorithm>
 #include <string>
 
 #include "data.hpp"