From: Collin Funk Date: Fri, 20 Feb 2026 05:40:44 +0000 (-0800) Subject: maint: fmt: prefer static initialization X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=395fcca795413561dcea9291fa51a068dc0d62f2;p=thirdparty%2Fcoreutils.git maint: fmt: prefer static initialization * src/fmt.c (prefix, max_width): Initialize variables. (main): Remove unnecessary initializations. --- diff --git a/src/fmt.c b/src/fmt.c index bb1412057d..3f76f6ec68 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -182,11 +182,11 @@ static bool split; static bool uniform; /* Prefix minus leading and trailing spaces (default ""). */ -static char const *prefix; +static char const *prefix = ""; /* User-supplied maximum line width (default WIDTH). The only output lines longer than this will each comprise a single word. */ -static int max_width; +static int max_width = WIDTH; /* Values derived from the option values. */ @@ -344,11 +344,6 @@ main (int argc, char **argv) atexit (close_stdout); - crown = tagged = split = uniform = false; - max_width = WIDTH; - prefix = ""; - prefix_length = prefix_lead_space = prefix_full_length = 0; - if (argc > 1 && argv[1][0] == '-' && c_isdigit (argv[1][1])) { /* Old option syntax; a dash followed by one or more digits. */