summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2018-09-10 23:56:42 -0400
committerchrome-bot <chrome-bot@chromium.org>2018-09-13 06:14:13 -0700
commit2495d9902bf9107a95adea3528ad8164e53e87da (patch)
tree8baf9653e3342b2e7904ea59a587e6a1ca08a38a
parent2f52ccad33f72927bf5beee2b484da8325eec062 (diff)
downloadvboot-2495d9902bf9107a95adea3528ad8164e53e87da.tar.gz
crossystem: fix field alignment
clear_tpm_owner_request is 23 chars now. BUG=None TEST=`crossystem` is aligned BRANCH=None Change-Id: I6d077b7311c74c51fd608281ad48b29fc6219937 Reviewed-on: https://chromium-review.googlesource.com/1218502 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--utility/crossystem.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/utility/crossystem.c b/utility/crossystem.c
index 64b7a973..ee7795e3 100644
--- a/utility/crossystem.c
+++ b/utility/crossystem.c
@@ -113,6 +113,9 @@ const Param sys_param_list[] = {
{NULL, 0, NULL}
};
+/* Longest Param name. */
+static const int kNameWidth = 23;
+
/* Print help */
void PrintHelp(const char *progname) {
@@ -132,7 +135,7 @@ void PrintHelp(const char *progname) {
"\n"
"Valid parameters:\n", progname, progname, progname, progname);
for (p = sys_param_list; p->name; p++)
- printf(" %-22s %s\n", p->name, p->desc);
+ printf(" %-*s %s\n", kNameWidth, p->name, p->desc);
}
@@ -236,8 +239,8 @@ int PrintAllParams(int force_all) {
value = buf;
}
}
- printf("%-22s = %-30s # %s\n",
- p->name, (value ? value : "(error)"), p->desc);
+ printf("%-*s = %-30s # %s\n",
+ kNameWidth, p->name, (value ? value : "(error)"), p->desc);
}
return retval;
}