Commit Diff


commit - 56e083741cf968c178f5d3469c12721f931f6abb
commit + 2f06f21f3804bf9bb554c615ffa9379f4c10dd7e
blob - 33fe7ca1a36172d2aa4a07e4f8ca4f0966969fff
blob + e5ee6dd39ffde161751e1ce10e4cc93924b7ffbe
--- lsblk.c
+++ lsblk.c
@@ -72,7 +72,7 @@ static char *stripdisk (char *n)
     const size_t ln = strnlen (n, 16);
     const size_t ls = sizeof sufx - 1;
 
-    if (!memcmp (n + ln - ls, sufx, ls)) {
+    if (memcmp (n + ln - ls, sufx, ls) == 0) {
         n[ln - ls] = '\0';
     }
 
@@ -81,12 +81,10 @@ static char *stripdisk (char *n)
 
 static void print_size (uint64_t sz)
 {
-    struct unit {
+    const struct unit {
         char sym;
         uint64_t factor;
-    };
-
-    const struct unit units[] = {
+    } units[] = {
         { 'P', 1ull << 50 },
         { 'T', 1ull << 40 },
         { 'G', 1ull << 30 },