From 49fd5d262c6764b0a6746cfdb267e8bebec49256 Mon Sep 17 00:00:00 2001 From: Jerry Zhang Date: Thu, 17 May 2018 12:54:41 -0700 Subject: [PATCH] recovery: Reset optind to 1 after getopt The getopt library exposes optind which is the next index to be processed. When scanning is restarted, optind has to be reset to 1. Test: Recovery works Bug: 78793464 Change-Id: I1efca3fb985ffbdfe91e43767469733cda6e7d5b --- recovery.cpp | 1 + recovery_main.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/recovery.cpp b/recovery.cpp index b1a2900f..21f63301 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -1049,6 +1049,7 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector