summaryrefslogtreecommitdiffstats
path: root/adbbu/adbbumain.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2018-08-24 18:17:36 +0200
committerEthan Yonker <dees_troy@teamw.in>2018-08-24 18:17:39 +0200
commit58f2132bc3954fc704787d477500a209eedb8e29 (patch)
treeeb0f79aacd68724b0c0c091018384ef924380f47 /adbbu/adbbumain.cpp
parentRemove remaining pieces of supersu (diff)
parentSnap for 4745538 from 723056a83f8c8b15af02d9c302862dbb2304ea8c to pi-release (diff)
downloadandroid_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.gz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.bz2
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.lz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.xz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.zst
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.zip
Diffstat (limited to '')
-rw-r--r--adbbu/adbbumain.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/adbbu/adbbumain.cpp b/adbbu/adbbumain.cpp
index 2e66bceb6..bd96b2040 100644
--- a/adbbu/adbbumain.cpp
+++ b/adbbu/adbbumain.cpp
@@ -32,9 +32,9 @@
int main(int argc, char **argv) {
int index;
- int pos = 0;
+ size_t pos = 0;
bool ret = false;
- int maxpos = sizeof(TWRPARG + 2);
+ size_t maxpos = strlen(TWRPARG) + 2;
std::string command;
twrpback tw;
@@ -45,10 +45,10 @@ int main(int argc, char **argv) {
}
pos = command.find(TWRP_BACKUP_ARG);
- if (pos < 0 || pos > (maxpos + sizeof(TWRP_BACKUP_ARG) + 1)) {
+ if (pos == std::string::npos || pos > (maxpos + strlen(TWRP_BACKUP_ARG) + 1)) {
pos = command.find(TWRP_RESTORE_ARG);
}
- if (pos < 0 || pos > maxpos + sizeof(TWRP_STREAM_ARG + 1)) {
+ if (pos == std::string::npos || pos > maxpos + strlen(TWRP_STREAM_ARG) + 1) {
pos = command.find(TWRP_STREAM_ARG);
}