mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-26 12:27:28 +08:00
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:
@@ -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){
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user