]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
blkid: add curly braces to do-while statement
authorSami Kerola <kerolasa@iki.fi>
Sun, 5 Mar 2017 20:52:24 +0000 (20:52 +0000)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Mar 2017 14:24:57 +0000 (15:24 +0100)
Some say people read do-while statements are easily as while statements and
get wrong impression.  This happens because do-whiles are not common.
Adding braces should make it easier to read the code.

Reference: http://www.spinics.net/lists/linux-kernel-janitors/msg02018.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/blkid.c

index 9278553c7045550fb53ccebd927242a0420838db..7bbb54dfd513b754298ff63545d003abafc5eac5 100644 (file)
@@ -139,9 +139,9 @@ static int pretty_print_word(const char *str, int max_len,
                len = 0;
        } else if (len > max_len)
                ret = len - max_len;
-       do
+       do {
                fputc(' ', stdout);
-       while (len++ < max_len);
+       while (len++ < max_len);
        return ret;
 }