Fix mosquitto_sub encoding of special characters with %j format.

Thanks to Ben Barbour.

Closes #1220.
pull/1239/head
Roger A. Light 7 years ago
parent 5b7b5ea158
commit cba3380b98

@ -50,6 +50,8 @@ Client features:
Client fixes:
- mosquitto_pub wouldn't always publish all messages when using `-l` and
QoS>0. This has been fixed.
- mosquitto_sub was incorrectly encoding special characters when using %j
output format. Closes #1220.
1.5.8 - 20190228

@ -101,7 +101,7 @@ static void write_json_payload(const char *payload, int payloadlen)
for(i=0; i<payloadlen; i++){
if(payload[i] == '"' || payload[i] == '\\' || (payload[i] >=0 && payload[i] < 32)){
printf("\\u%04d", payload[i]);
printf("\\u%04x", payload[i]);
}else{
fputc(payload[i], stdout);
}

Loading…
Cancel
Save