Fix mosquitto_sub %j or %J not working on Windows.

Closes #1674. Thanks to amigian74.
This commit is contained in:
Roger A. Light 2020-05-06 22:24:58 +01:00
parent c343812c42
commit 24049b1a1e
2 changed files with 4 additions and 1 deletions

View File

@ -12,6 +12,9 @@ Client library:
- Don't treat an unexpected PUBACK, PUBREL, or PUBCOMP as a fatal error. - Don't treat an unexpected PUBACK, PUBREL, or PUBCOMP as a fatal error.
Issue #1629. Issue #1629.
Clients:
- Fix mosquitto_sub %j or %J not working on Windows. Closes #1674.
Build: Build:
- Various fixes for building with <C99 support. Closes #1622. - Various fixes for building with <C99 support. Closes #1622.
- Fix use of sed on BSD. Closes #1614. - Fix use of sed on BSD. Closes #1614.

View File

@ -114,7 +114,7 @@ static void json_print(const struct mosquitto_message *message, const struct tm
{ {
char buf[100]; char buf[100];
strftime(buf, 100, "%s", ti); snprintf(buf, 100, "%ld", time(NULL));
printf("{\"tst\":%s,\"topic\":\"%s\",\"qos\":%d,\"retain\":%d,\"payloadlen\":%d,", buf, message->topic, message->qos, message->retain, message->payloadlen); printf("{\"tst\":%s,\"topic\":\"%s\",\"qos\":%d,\"retain\":%d,\"payloadlen\":%d,", buf, message->topic, message->qos, message->retain, message->payloadlen);
if(message->qos > 0){ if(message->qos > 0){
printf("\"mid\":%d,", message->mid); printf("\"mid\":%d,", message->mid);