From f1c0ad52790bb05a672c1e4219c2ff8cf301a6f6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 26 Aug 2023 12:22:46 +0200 Subject: [PATCH] shared/id128-print: fix indentation, reduce variable scope --- src/shared/id128-print.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/shared/id128-print.c b/src/shared/id128-print.c index f232767adf..c9509b28f0 100644 --- a/src/shared/id128-print.c +++ b/src/shared/id128-print.c @@ -11,12 +11,10 @@ #include "terminal-util.h" int id128_pretty_print_sample(const char *name, sd_id128_t id) { - _cleanup_free_ char *man_link = NULL, *mod_link = NULL; - const char *on, *off; - unsigned i; + _cleanup_free_ char *man_link = NULL, *mod_link = NULL; - on = ansi_highlight(); - off = ansi_normal(); + const char *on = ansi_highlight(), + *off = ansi_normal(); if (terminal_urlify("man:systemd-id128(1)", "systemd-id128(1)", &man_link) < 0) return log_oom(); @@ -34,8 +32,8 @@ int id128_pretty_print_sample(const char *name, sd_id128_t id) { on, SD_ID128_FORMAT_VAL(id), off, man_link, on, name); - for (i = 0; i < 16; i++) - printf("%02x%s", id.bytes[i], i != 15 ? "," : ""); + for (size_t i = 0; i < 16; i++) + printf("%02x%s", id.bytes[i], i < 15 ? "," : ""); printf(")%s\n\n", off); printf("As Python constant:\n" -- 2.25.1