Skip to content

Commit 37d62c1

Browse files
supercomputer7timschumi
authored andcommitted
Utilities: Initialize raw variables to default values in some utilities
1 parent 9275743 commit 37d62c1

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

Userland/Utilities/arp.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
2828
{
2929
TRY(Core::System::pledge("stdio rpath tty inet unix"));
3030

31-
static bool flag_set;
32-
static bool flag_delete;
33-
static bool flag_numeric;
31+
bool flag_set = false;
32+
bool flag_delete = false;
33+
bool flag_numeric = false;
3434
StringView value_ipv4_address;
3535
StringView value_hw_address;
3636

Userland/Utilities/sleep.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <time.h>
1616
#include <unistd.h>
1717

18-
static bool volatile g_interrupted;
18+
static bool volatile g_interrupted = false;
1919
static void handle_sigint(int)
2020
{
2121
g_interrupted = true;

Userland/Utilities/slugify.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
1818
Vector<String> inputs;
1919
String output_type;
2020
char glue = '-';
21-
bool spa;
21+
bool spa = false;
2222

2323
Core::ArgsParser parser;
2424
parser.set_general_help("Slugify is a simple text to slug transform utility\n$ slugify 'Serenity is a cool ### PROject123.'");

Userland/Utilities/tar.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
3838
bool xz = false;
3939
bool no_auto_compress = false;
4040
StringView archive_file;
41-
bool dereference;
41+
bool dereference = false;
4242
StringView directory;
4343
Vector<ByteString> paths;
4444

Userland/Utilities/test-imap.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
1919
}
2020

2121
ByteString host;
22-
int port;
22+
int port = 0;
2323
bool tls { false };
2424

2525
ByteString username;
2626
Core::SecretString password;
27-
bool interactive_password;
27+
bool interactive_password = false;
2828

2929
Core::ArgsParser args_parser;
3030
args_parser.add_option(interactive_password, "Prompt for password with getpass", "interactive", 'i');

Userland/Utilities/tsort.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
9696
TRY(Core::System::pledge("stdio rpath"));
9797

9898
StringView path;
99-
bool quiet;
99+
bool quiet = false;
100100

101101
Core::ArgsParser args_parser;
102102
args_parser.add_positional_argument(path, "Path to file", "path", Core::ArgsParser::Required::No);

0 commit comments

Comments
 (0)