[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
This commit is contained in:
Roger A. Light
2015-12-18 22:29:32 +00:00
parent 148df82144
commit c5a376489e
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -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
================
+1 -1
View File
@@ -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);