[lsblk] fix bug in flag rendering
cmd_list_blk() did not correctly initialize the print buffer it was
using for partition flags between loops. Fixed.
Tests: ran lsblk
Change-Id: Ifb0c83b0904816fdb60327e55c1f32007fc6c91d
diff --git a/zircon/system/uapp/lsblk/main.cc b/zircon/system/uapp/lsblk/main.cc
index 861c43f..8ed9706 100644
--- a/zircon/system/uapp/lsblk/main.cc
+++ b/zircon/system/uapp/lsblk/main.cc
@@ -98,7 +98,6 @@
blkinfo_t info;
const char* type;
printf("%-3s %-4s %-16s %-20s %-6s %s\n", "ID", "SIZE", "TYPE", "LABEL", "FLAGS", "DEVICE");
- char flags[20] = {0};
while ((de = readdir(dir)) != NULL) {
if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..")) {
@@ -140,6 +139,7 @@
} else {
info.label[0] = '\0';
}
+ char flags[20] = {0};
if (block_info.flags & BLOCK_FLAG_READONLY) {
strlcat(flags, "RO ", sizeof(flags));
}