Commit ee227ff5 authored by Ian Craggs's avatar Ian Craggs

Fix for issue #286

parent b82797a7
...@@ -2317,7 +2317,7 @@ int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions* options) ...@@ -2317,7 +2317,7 @@ int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions* options)
m->c->username = options->username; m->c->username = options->username;
m->c->password = options->password; m->c->password = options->password;
if (options->password) if (options->password)
m->c->passwordlen = strlen(options->password) + 1; m->c->passwordlen = strlen(options->password);
else if (options->struct_version >= 5 && options->binarypwd.data) else if (options->struct_version >= 5 && options->binarypwd.data)
{ {
m->c->password = options->binarypwd.data; m->c->password = options->binarypwd.data;
......
...@@ -1100,7 +1100,7 @@ static int MQTTClient_connectURI(MQTTClient handle, MQTTClient_connectOptions* o ...@@ -1100,7 +1100,7 @@ static int MQTTClient_connectURI(MQTTClient handle, MQTTClient_connectOptions* o
m->c->username = options->username; m->c->username = options->username;
m->c->password = options->password; m->c->password = options->password;
if (options->password) if (options->password)
m->c->passwordlen = strlen(options->password) + 1; m->c->passwordlen = strlen(options->password);
else if (options->struct_version >= 5 && options->binarypwd.data) else if (options->struct_version >= 5 && options->binarypwd.data)
{ {
m->c->password = options->binarypwd.data; m->c->password = options->binarypwd.data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment