release-request-b45781ff-b719-488b-ad10-06b90910709b-for-git_pi-release-4344268 snap-temp-L16300000103640188

Change-Id: I7f5dbb4a809de63c215d77cc93f0854b55b7e2b4
diff --git a/tests/component/imgdiff_test.cpp b/tests/component/imgdiff_test.cpp
index 3163a57..7351605 100644
--- a/tests/component/imgdiff_test.cpp
+++ b/tests/component/imgdiff_test.cpp
@@ -779,9 +779,10 @@
   // Compute patch.
   TemporaryFile patch_file;
   TemporaryDir debug_dir;
+  std::string debug_dir_arg = android::base::StringPrintf("--debug-dir=%s", debug_dir.path);
   std::vector<const char*> args = {
-    "imgdiff", "-z", "--block-limit=10", android::base::StringPrintf(
-          "--debug-dir=%s", debug_dir.path).c_str(), src_file.path, tgt_file.path, patch_file.path,
+    "imgdiff", "-z", "--block-limit=10", debug_dir_arg.c_str(), src_file.path, tgt_file.path,
+    patch_file.path,
   };
   ASSERT_EQ(0, imgdiff(args.size(), args.data()));
 
@@ -901,9 +902,10 @@
   // Compute patch.
   TemporaryFile patch_file;
   TemporaryDir debug_dir;
+  std::string debug_dir_arg = android::base::StringPrintf("--debug-dir=%s", debug_dir.path);
   std::vector<const char*> args = {
-    "imgdiff", "-z", "--block-limit=10", android::base::StringPrintf(
-          "--debug-dir=%s", debug_dir.path).c_str(), src_file.path, tgt_file.path, patch_file.path,
+    "imgdiff", "-z", "--block-limit=10", debug_dir_arg.c_str(), src_file.path, tgt_file.path,
+    patch_file.path,
   };
   ASSERT_EQ(0, imgdiff(args.size(), args.data()));
 
@@ -940,9 +942,10 @@
   // Compute patch with a limit of 20 blocks.
   TemporaryFile patch_file;
   TemporaryDir debug_dir;
+  std::string debug_dir_arg = android::base::StringPrintf("--debug-dir=%s", debug_dir.path);
   std::vector<const char*> args = {
-    "imgdiff", "-z", "--block-limit=20", android::base::StringPrintf(
-          "--debug-dir=%s", debug_dir.path).c_str(), src_file.path, tgt_file.path, patch_file.path,
+    "imgdiff", "-z", "--block-limit=20", debug_dir_arg.c_str(), src_file.path, tgt_file.path,
+    patch_file.path,
   };
   ASSERT_EQ(0, imgdiff(args.size(), args.data()));