Fix calls to logwrap
Make sure all the calls to logwrap are consistent with the function's
semantics.
Change-Id: Ib0e2ad5c283cc4bb06c0ef5d6a9a52a5840b3dd2
diff --git a/Ext4.cpp b/Ext4.cpp
index 4ec0616..c99d801 100644
--- a/Ext4.cpp
+++ b/Ext4.cpp
@@ -39,6 +39,7 @@
#include <cutils/properties.h>
#include "Ext4.h"
+#include "VoldUtil.h"
#define MKEXT4FS_PATH "/system/bin/make_ext4fs";
@@ -69,7 +70,7 @@
int Ext4::format(const char *fsPath, const char *mountpoint) {
int fd;
- const char *args[6];
+ const char *args[5];
int rc;
args[0] = MKEXT4FS_PATH;
@@ -77,8 +78,7 @@
args[2] = "-a";
args[3] = mountpoint;
args[4] = fsPath;
- args[5] = NULL;
- rc = logwrap(5, args, 1);
+ rc = logwrap(ARRAY_SIZE(args), args, 1);
if (rc == 0) {
SLOGI("Filesystem (ext4) formatted OK");