Remove redundant initialization in clients

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 <vulxj0j8j8@gmail.com>
This commit is contained in:
YangHau
2019-07-12 16:53:29 +08:00
parent 2b2afc93bc
commit 9bb9b6e721
3 changed files with 0 additions and 5 deletions
-1
View File
@@ -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){
-2
View File
@@ -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();
-2
View File
@@ -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();