From 6413840b2f2ad7d17b3cad3fbe868d1472a57016 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 3 Feb 2021 10:15:36 +0000 Subject: [PATCH] Clients: Fix config files truncating options after the first space. Closes #2059. Thanks to Jason White. --- ChangeLog.txt | 1 + client/client_shared.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 9d6c4ed9b8..d8e32d44df 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -19,6 +19,7 @@ Client library: Clients: - mosquitto_sub will now quit with an error if the %U option is used on Windows, rather than just quitting. Closes #1908. +- Fix config files truncating options after the first space. Closes #2059. Apps: - Perform stricter parsing of input username in mosquitto_passwd. Closes diff --git a/client/client_shared.c b/client/client_shared.c index f5514b1359..b7222a9eb4 100644 --- a/client/client_shared.c +++ b/client/client_shared.c @@ -299,7 +299,7 @@ int client_config_load(struct mosq_config *cfg, int pub_or_sub, int argc, char * * program name as the first entry. */ args[1] = strtok(line, " "); if(args[1]){ - args[2] = strtok(NULL, " "); + args[2] = strtok(NULL, ""); if(args[2]){ count = 3; }else{