Skip to content

Commit

Permalink
Remove redundant initialization in clients
Browse files Browse the repository at this point in the history
the `memset(&cfg, 0, sizeof(struct mosq_config));` already exsits in
`client_config_load()`'s `init_config()` function call.
So calling it in main function is totally unnecessary.

Signed-off-by: YangHau <[email protected]>
  • Loading branch information
howjmay authored and ralight committed Sep 17, 2019
1 parent 8c1d380 commit 203c0ab
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion client/pub_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ int main(int argc, char *argv[])

if(pub_shared_init()) return 1;

memset(&cfg, 0, sizeof(struct mosq_config));
rc = client_config_load(&cfg, CLIENT_PUB, argc, argv);
if(rc){
if(rc == 2){
Expand Down
2 changes: 0 additions & 2 deletions client/rr_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,6 @@ int main(int argc, char *argv[])
#ifndef WIN32
struct sigaction sigact;
#endif

memset(&cfg, 0, sizeof(struct mosq_config));

mosquitto_lib_init();

Expand Down
2 changes: 0 additions & 2 deletions client/sub_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,6 @@ int main(int argc, char *argv[])
#ifndef WIN32
struct sigaction sigact;
#endif

memset(&cfg, 0, sizeof(struct mosq_config));

mosquitto_lib_init();

Expand Down

0 comments on commit 203c0ab

Please sign in to comment.