From 00b260587cea0671801a34bf15840ea47b42ab39 Mon Sep 17 00:00:00 2001 From: Vojtech Bocek Date: Sat, 13 Jul 2013 02:21:32 +0200 Subject: Fix TWFunc::tw_chmod() for 3-character mode string --- twrp-functions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/twrp-functions.cpp b/twrp-functions.cpp index d9014b364..29c70a52b 100644 --- a/twrp-functions.cpp +++ b/twrp-functions.cpp @@ -589,7 +589,8 @@ bool TWFunc::Fix_su_Perms(void) { int TWFunc::tw_chmod(string fn, string mode) { long mask = 0; - for ( std::string::size_type n = 0; n < mode.length(); ++n) { + std::string::size_type n = (mode.length() == 3) ? 1 : 0; + for (; n < mode.length(); ++n) { if (n == 0) { if (mode[n] == '0') continue; -- cgit v1.2.3