aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/client_main.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-05-13 10:58:41 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-05-13 11:37:46 +0200
commitcd917f48454875ad6b7fc69455281d72760c44ee (patch)
tree70a7a43fe43b7f893468f9120def5513774a242c /src/client_main.c
parentadd command module to handle request-response communications (diff)
downloadcimple-cd917f48454875ad6b7fc69455281d72760c44ee.tar.gz
cimple-cd917f48454875ad6b7fc69455281d72760c44ee.zip
best practices & coding style fixes
* I don't really need to declare all variables at the top of the function anymore. * Default-initialize variables more. * Don't set the output parameter until the object is completely constructed.
Diffstat (limited to 'src/client_main.c')
-rw-r--r--src/client_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client_main.c b/src/client_main.c
index dd22508..c402b20 100644
--- a/src/client_main.c
+++ b/src/client_main.c
@@ -10,6 +10,7 @@
#include "const.h"
#include <getopt.h>
+#include <stdlib.h>
static struct settings default_settings()
{
@@ -62,7 +63,7 @@ static int parse_settings(struct settings *settings, int argc, char *argv[])
int main(int argc, char *argv[])
{
struct settings settings;
- struct client *client;
+ struct client *client = NULL;
int ret = 0;
ret = parse_settings(&settings, argc, argv);