Utilities: Initialize raw variables to default values in some utilities

This commit is contained in:
Liav A. 2024-04-28 17:02:23 +03:00 committed by Tim Schumacher
parent 9275743626
commit 37d62c16f8
Notes: sideshowbarker 2024-07-17 05:02:35 +09:00
6 changed files with 9 additions and 9 deletions

View file

@ -28,9 +28,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath tty inet unix"));
static bool flag_set;
static bool flag_delete;
static bool flag_numeric;
bool flag_set = false;
bool flag_delete = false;
bool flag_numeric = false;
StringView value_ipv4_address;
StringView value_hw_address;

View file

@ -15,7 +15,7 @@
#include <time.h>
#include <unistd.h>
static bool volatile g_interrupted;
static bool volatile g_interrupted = false;
static void handle_sigint(int)
{
g_interrupted = true;

View file

@ -18,7 +18,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
Vector<String> inputs;
String output_type;
char glue = '-';
bool spa;
bool spa = false;
Core::ArgsParser parser;
parser.set_general_help("Slugify is a simple text to slug transform utility\n$ slugify 'Serenity is a cool ### PROject123.'");

View file

@ -38,7 +38,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool xz = false;
bool no_auto_compress = false;
StringView archive_file;
bool dereference;
bool dereference = false;
StringView directory;
Vector<ByteString> paths;

View file

@ -19,12 +19,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
ByteString host;
int port;
int port = 0;
bool tls { false };
ByteString username;
Core::SecretString password;
bool interactive_password;
bool interactive_password = false;
Core::ArgsParser args_parser;
args_parser.add_option(interactive_password, "Prompt for password with getpass", "interactive", 'i');

View file

@ -96,7 +96,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::pledge("stdio rpath"));
StringView path;
bool quiet;
bool quiet = false;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(path, "Path to file", "path", Core::ArgsParser::Required::No);