[483979] Fix "mosquitto_pub -l" stripping the final character on a line.

Thanks to Allan Kobelansky.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=483979
pull/145/head
Roger A. Light 10 years ago
parent 148df82144
commit c5a376489e

@ -3,8 +3,11 @@
Client library:
- Fix _mosquitto_socketpair() on Windows, reducing the chance of delays when
publishing. Closes #484693.
publishing. Closes #483979.
Clients:
- Fix "mosquitto_pub -l" stripping the final character on a line. Closes
#483981.
1.4.5 - 20151108
================

@ -392,7 +392,7 @@ int main(int argc, char *argv[])
buf_len_actual = strlen(buf);
if(buf[buf_len_actual-1] == '\n'){
buf[buf_len_actual-1] = '\0';
rc2 = mosquitto_publish(mosq, &mid_sent, topic, buf_len_actual, buf, qos, retain);
rc2 = mosquitto_publish(mosq, &mid_sent, topic, buf_len_actual-1, buf, qos, retain);
if(rc2){
if(!quiet) fprintf(stderr, "Error: Publish returned %d, disconnecting.\n", rc2);
mosquitto_disconnect(mosq);

Loading…
Cancel
Save